----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/replication.log
  log type:  text
 opened on:  15 Apr 2022, 14:10:59

.         
. *******************************************************************************************************************************************
. // 1 - Data Handling
. *******************************************************************************************************************************************
. 
.         * 1.A - Clean and geo-locate WWI casualty data
.         do "$path/Replication/1.A - Clean WW1 Casualties.do"

. /*-----------------------------------------------------------------------------------------------------------------------------------------
> File:                   Clean WW1 Casualties
> 
> Project:                WWI Discrimination (Ferrara & Fishback) 
> Last change:    22/JUN/2017 (AF)
> Version:                1.1
> 
> Change log:             
> 
> Purpose:                This do file geolocates and cleans the WWI casualties.
>                                 Part 1-A sets up town/city/place names from geonames.org
>                                          1-B sets up town/city/places names from NHGIS
>                                          1-C brings Navy casualty lists into the Army list format
>                                 Part 2   cleans location info of soldiers and assigns county & state FIPS codes
>                                 Part 3   cleans the names of soldiers (in case we want to link them to the Census)
> -----------------------------------------------------------------------------------------------------------------------------------------*/
. 
. 
. clear all

. capture set more off

. 
. * Stata routines needing to be installed prior to running this code
. ssc install strrec
checking strrec consistency and verifying not already installed...
all files already exist and are up to date.

. ssc install freqindex
checking freqindex consistency and verifying not already installed...
all files already exist and are up to date.

. 
. 
. 
. *******************************************************************************************************************************************
. // Admin
. *******************************************************************************************************************************************
. /*
>         // Set directory path
>         foreach i in "C:/Users/Andy/Dropbox/projects/WWI German Discrimination"         ///
>                                  "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"   ///
>                                  "Z:/Dropbox/projects/WWI German Discrimination"                                {
>                 
>                                 global path "`i'"
>                                 confirmdir "$path"
>                                 if `r(confirmdir)'==0 continue, break
>         }
> */
. 
. 
. *******************************************************************************************************************************************
. // 1-A) Geonames org place list
. *******************************************************************************************************************************************
. 
.         use "$path/Replication/raw_data/geonamesorg_places_1910.dta"

.         
.         replace name = upper(name)
(192,681 real changes made)

.         
.         replace name = subinstr(name, "ST.", "SAINT", .)
(9 real changes made)

.         replace name = subinstr(name, "NORTH ", "", .)
(1,539 real changes made)

.         replace name = subinstr(name, "SOUTH ", "", .)
(1,234 real changes made)

.         replace name = subinstr(name, "WEST ", "", .)
(1,763 real changes made)

.         replace name = subinstr(name, "EAST ", "", .)
(1,328 real changes made)

.         replace name = subinstr(name, "(HISTORICAL)", "", .)
(9,830 real changes made)

.         
.         replace name = strtrim(name)
(9,826 real changes made)

.         replace name = stritrim(name)
(0 real changes made)

.         
.         * drop Alaska and Hawaii
.         drop if state=="AK" | state=="HI"
(1,793 observations deleted)

.         
.         * save town/city/place lists for each state as a separate temp file
.         qui levelsof state, local(statelvl)

.         
.         qui foreach s of local statelvl {

.         
.         clear

. 
. 
. *******************************************************************************************************************************************
. // 1-B) NHGIS 1910 place list
. *******************************************************************************************************************************************
. 
.         use "$path/Replication/raw_data/placenames1910.dta"

.         
.         replace city = subinstr(city, "ST.", "SAINT", .)
(0 real changes made)

.         replace city = subinstr(city, "NORTH ", "", .)
(68 real changes made)

.         replace city = subinstr(city, "SOUTH ", "", .)
(77 real changes made)

.         replace city = subinstr(city, "WEST ", "", .)
(112 real changes made)

.         replace city = subinstr(city, "EAST ", "", .)
(72 real changes made)

.         
.         replace city = strtrim(city)
(0 real changes made)

.         replace city = stritrim(city)
(0 real changes made)

.         
.         * save town/city/place lists for each state as a separate temp file
.         qui levelsof STATE, local(statelvl2)

.         
.         qui foreach s of local statelvl2 {

.         
.         clear

. 
.         
. *******************************************************************************************************************************************
. // 1-C) Clean Navy Casualties
. *******************************************************************************************************************************************
. 
.         clear

.         use "$path/Replication/raw_data/Deaths in the US Navy from April 1917 to November 1918.dta"

. 
.         * clean string variable
.         replace var1 = upper(var1)
(7,567 real changes made)

. 
.         foreach c in 33 34 35 38 46 47 58 59 62 63 124 125 128 147 153 226 {
  2.                 replace var1 = subinstr(var1, `"`=char(`c')'"', "", .)
  3.         }
(2 real changes made)
(11 real changes made)
(35 real changes made)
(29 real changes made)
(1,159 real changes made)
(72 real changes made)
(14 real changes made)
(7,267 real changes made)
(2 real changes made)
(4 real changes made)
(1 real change made)
(1 real change made)
(96 real changes made)
(2 real changes made)
(94 real changes made)
(96 real changes made)

. 
.         replace var1 = subinstr(var1, ", JR", " JR", .)
(124 real changes made)

.         replace var1 = subinstr(var1, ", SR", " SR", .)
(40 real changes made)

. 
.         replace var1 = subinstr(var1, ", 1ST", " 1ST", .)
(700 real changes made)

.         replace var1 = subinstr(var1, ", 2ND", " 2ND", .)
(2,763 real changes made)

.         replace var1 = subinstr(var1, ", 3RD", " 3RD", .)
(1,062 real changes made)

.         replace var1 = subinstr(var1, ", 4TH", " 4TH", .)
(42 real changes made)

. 
.         replace var1 = subinstr(var1, ", USNR", " USNR", .)
(3,396 real changes made)

.         replace var1 = subinstr(var1, ", USCG", " USCG", .)
(201 real changes made)

.         replace var1 = subinstr(var1, ", US ", " US ", .)
(76 real changes made)

.         replace var1 = subinstr(var1, ", USS ", " USS", .)
(2,001 real changes made)

.         replace var1 = subinstr(var1, ", UNITED", " UNITED", .)
(18 real changes made)

. 
.         replace var1 = subinstr(var1, "(CLASS", "[CLASS", .)
(195 real changes made)

.         replace var1 = subinstr(var1, "(OTHER", "[OTHER", .)
(80 real changes made)

.         replace var1 = subinstr(var1, "(LATER", "[LATER", .)
(460 real changes made)

. 
.         replace var1 = subinstr(var1, "(CHIEF)", "[CHIEF]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(FEMALE)", "[FEMALE]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(RESERVE)", "[RESERVE]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(RIGHT)", "[RIGHT]", .)
(11 real changes made)

.         replace var1 = subinstr(var1, "(INACTIVE)", "[INACTIVE]", .)
(2 real changes made)

.         replace var1 = subinstr(var1, "(RADIO)", "[RADIO]", .)
(4 real changes made)

.         replace var1 = subinstr(var1, "(?)", "[?]", .)
(0 real changes made)

.         replace var1 = subinstr(var1, "(ACTING)", "[ACTING]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(GCMP)", "[GCMP]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(MB)", "[MB]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(S)", "[S]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(SIGNALMAN)", "[SIGNALMAN]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(RETIRED)", "[RETIRED]", .)
(50 real changes made)

.         replace var1 = subinstr(var1, "(SUPPLY CORPS)", "[SUPPLY CORPS]", .)
(8 real changes made)

.         replace var1 = subinstr(var1, "(MEDICAL CORPS)", "[MEDICAL CORPS]", .)
(19 real changes made)

.         replace var1 = subinstr(var1, "(GENERAL COURTMARTIAL PRISONER)", "[GENERAL COURTMARTIAL PRISONER]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(GENERAL COURT-MARTIAL PRISONER)", "[GENERAL COURT-MARTIAL PRISONER]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(NOT IN ACTIVE SERVICE)", "[NOT IN ACTIVE SERVICE]", .)
(74 real changes made)

.         replace var1 = subinstr(var1, "(NOTE FATHER'S NAME)", "[NOTE FATHER'S NAME]", .)
(4 real changes made)

.         replace var1 = subinstr(var1, "(G C M P)","[G C M P]", .)
(2 real changes made)

.         replace var1 = subinstr(var1, "(TEMPORARY)","[TEMPORARY]", .)
(7 real changes made)

.         replace var1 = subinstr(var1, "(PAY CORPS)", "[PAY CORPS]", .)
(2 real changes made)

.         replace var1 = subinstr(var1, "(CIVIL ENGINEER CORPS)" ,"[CIVIL ENGINEER CORPS]", .)
(1 real change made)

.         replace var1 = subinstr(var1, "(2ND CLASS)", "[2ND CLASS]", .)
(1 real change made)

. 
.         replace var1 = subinstr(var1, "(A)",  "[A]", .)
(229 real changes made)

.         replace var1 = subinstr(var1, "(R)",  "[B]", .)
(192 real changes made)

.         replace var1 = subinstr(var1, "(G)",  "[G]", .)
(77 real changes made)

.         replace var1 = subinstr(var1, "(JG)", "[JG]", .)
(74 real changes made)

.         replace var1 = subinstr(var1, "(E)",  "[E]", .)
(3 real changes made)

.         replace var1 = subinstr(var1, "(F)",  "[F]", .)
(18 real changes made)

.         replace var1 = subinstr(var1, "(SC)", "[SC]", .)
(2 real changes made)

.         replace var1 = subinstr(var1, "(T)",  "[T]", .)
(5 real changes made)

. 
.         replace var1 = strtrim(var1)
(396 real changes made)

.         replace var1 = stritrim(var1)
(45 real changes made)

. 
.         split var1, p("(")
variables created as string: 
var11  var12  var13  var14  var15

. 
.         replace var12 = var12 + " " + var13 + " " + var14 + " " + var15
variable var12 was str289 now str713
(7,567 real changes made)

.         replace var12 = strtrim(var12)
(7,558 real changes made)

. 
.         drop var13- var15

. 
.         split var12, p("ENLISTED" "APPOINTED" ")") limit(2)
variables created as string: 
var121  var122

. 
.         split var122, p(",") limit(2) gen(place)
variables created as string: 
place1  place2

. 
.         replace place2 = strtrim(place2)
(7,120 real changes made)

. 
.         replace place1 = "" if place2==""
(415 real changes made)

. 
.         replace place2 = "NY" if strpos(place2, "N Y")>0
(905 real changes made)

.         replace place2 = "IL" if place2=="ILL"
(444 real changes made)

.         replace place2 = "MA" if place2=="MASS" | place2=="BOSTON  MASS"
(440 real changes made)

.         replace place2 = "CA" if place2=="CALIF"
(325 real changes made)

.         replace place2 = "TX" if place2=="TEX"
(280 real changes made)

.         replace place2 = "MI" if place2=="MICH"
(202 real changes made)

.         replace place2 = "OH" if place2=="OHIO"
(183 real changes made)

.         replace place2 = "MO" if place2=="M'O"
(1 real change made)

.         replace place2 = "MN" if place2=="MINN"
(171 real changes made)

.         replace place2 = "WI" if place2=="WIS"
(161 real changes made)

.         replace place2 = "IN" if place2=="IND"
(148 real changes made)

.         replace place2 = "RI" if place2=="R I"
(147 real changes made)

.         replace place2 = "IA" if place2=="IOWA"
(134 real changes made)

.         replace place2 = "CT" if place2=="CONN"
(115 real changes made)

.         replace place2 = "NE" if place2=="NEBR"
(113 real changes made)

.         replace place2 = "TN" if place2=="TENN"
(114 real changes made)

.         replace place2 = "OR" if place2=="OREG" | place2=="ORE" | place2=="OREGON"
(101 real changes made)

.         replace place2 = "NJ" if place2=="N J"
(96 real changes made)

.         replace place2 = "DC" if place2=="D C"
(89 real changes made)

.         replace place2 = "SC" if place2=="S C"
(82 real changes made)

.         replace place2 = "NC" if place2=="N C"
(64 real changes made)

.         replace place2 = "WA" if place2=="WASH" | place2=="'WASH"
(89 real changes made)

.         replace place2 = "AL" if place2=="ALA"
(78 real changes made)

.         replace place2 = "CO" if place2=="COLO"
(69 real changes made)

.         replace place2 = "MS" if place2=="MISS"
(61 real changes made)

.         replace place2 = "UT" if place2=="UTAH"
(59 real changes made)

.         replace place2 = "OK" if place2=="OKLA"
(55 real changes made)

.         replace place2 = "AR" if place2=="ARK"
(46 real changes made)

.         replace place2 = "FL" if place2=="FLA"
(43 real changes made)

.         replace place2 = "WV" if place2=="W VA"
(42 real changes made)

.         replace place2 = "NH" if place2=="N H"
(13 real changes made)

.         replace place2 = "NY" if place2=="NEW YORK"
(7 real changes made)

.         replace place2 = "PA" if place2=="PHILADELPHIA" | place2=="PENNSYLVANIA" | place2=="PA -" | place2=="PA-"
(9 real changes made)

.         replace place2 = "MA" if place2=="BOSTON"
(4 real changes made)

.         replace place2 = "NY" if place2=="LONG ISLAND"
(4 real changes made)

.         replace place2 = "MT" if place2=="MONT"
(3 real changes made)

.         replace place2 = "MT" if place2=="NEV"
(2 real changes made)

.         replace place2 = "ID" if place2=="IDAHO"
(1 real change made)

.         replace place2 = "KS" if place2=="KANS"
(1 real change made)

.         replace place2 = "LA" if place2=="LOUISIANA"
(1 real change made)

.         replace place2 = "MD" if place2=="MD '"
(1 real change made)

. 
.         replace place2 = "" if place2!="NY" & place2!="IL" & place2!="MA" & place2!="CA" & place2!="TX" & place2!="MI" & place2!="OH" & place2!="MN" & ///
>                                                    place2!="WI" & place2!="IN" & place2!="RI" & place2!="IA" & place2!="CT" & place2!="NE" & place2!="TN" & place2!="OR" & ///
>                                                    place2!="NJ" & place2!="DC" & place2!="SC" & place2!="NC" & place2!="WA" & place2!="AL" & place2!="CO" & place2!="MS" & ///
>                                                    place2!="UT" & place2!="OK" & place2!="AR" & place2!="FL" & place2!="WV" & place2!="NH" & place2!="PA" & place2!="MA" & ///
>                                                    place2!="MT" & place2!="MO" & place2!="NV" & place2!="ID" & place2!="KS" & place2!="LA" & place2!="KY" & place2!="GA" & ///
>                                                    place2!="VA" & place2!="MD" & place2!="ME" & place2!="VT" & place2!="AZ" & place2!="DE" & place2!="NM" & place2!="WY" & ///
>                                                    place2!="SD" & place2!="ND"
(555 real changes made)

. 
.         gen word1 = word(var121, -1) if place2==""
(6,581 missing values generated)

.         gen word2 = word(var121, -2) if place2==""
(6,624 missing values generated)

.         gen word3 = word(var121, -3) if place2==""
(6,653 missing values generated)

. 
.         replace place2 = word2+word1 if length(word1)==1 & length(word2)==1 & place2==""
(264 real changes made)

. 
.         replace place2 = word1 if length(word1)==2 & place2==""
(194 real changes made)

. 
.         replace place2 = "MA" if word1=="MASS" & place2==""
(71 real changes made)

.         replace place2 = "FL" if word1=="FLA" & place2==""
(34 real changes made)

.         replace place2 = "CA" if word1=="CALIF" & place2==""
(42 real changes made)

.         replace place2 = "IL" if word1=="ILL" & place2==""
(26 real changes made)

.         replace place2 = "TX" if word1=="TEX" & place2==""
(10 real changes made)

.         replace place2 = "OH" if word1=="OHIO" & place2==""
(16 real changes made)

.         replace place2 = "MI" if word1=="MICH" & place2==""
(22 real changes made)

.         replace place2 = "TN" if word1=="TENN" & place2==""
(9 real changes made)

.         replace place2 = "IN" if word1=="IND" & place2==""
(12 real changes made)

.         replace place2 = "CT" if word1=="CONN" & place2==""
(16 real changes made)

.         replace place2 = "AL" if word1=="ALA" & place2==""
(11 real changes made)

.         replace place2 = "MS" if word1=="MISS" & place2==""
(2 real changes made)

.         replace place2 = "WI" if word1=="WIS" & place2==""
(12 real changes made)

.         replace place2 = "OR" if word1=="OREG" & place2==""
(6 real changes made)

.         replace place2 = "WA" if word1=="WASH" & place2==""
(9 real changes made)

.         replace place2 = "IA" if word1=="IOWA" & place2==""
(8 real changes made)

.         replace place2 = "KS" if word1=="KANS" & place2==""
(3 real changes made)

.         replace place2 = "CO" if word1=="COLO" & place2==""
(4 real changes made)

.         replace place2 = "DE" if word1=="DEL" & place2==""
(5 real changes made)

.         replace place2 = "MN" if word1=="MINN" & place2==""
(3 real changes made)

.         replace place2 = "OK" if word1=="OKLA" & place2==""
(4 real changes made)

.         replace place2 = "CA" if word1=="CAL" & place2==""
(2 real changes made)

.         replace place2 = "NE" if word1=="NEBR" & place2==""
(3 real changes made)

.         replace place2 = "PA" if word1=="PENN" & place2==""
(2 real changes made)

.         replace place2 = "WY" if word1=="WYO" & place2==""
(2 real changes made)

.         replace place2 = "AZ" if word1=="ARIZ" & place2==""
(1 real change made)

.         replace place2 = "ID" if word1=="IDAHO" & place2==""
(0 real changes made)

.         replace place2 = "KY" if word1=="KENTUCKY" & place2==""
(1 real change made)

. 
.         drop word*

. 
.         gen lastword = word(var122, -1)
(32 missing values generated)

. 
.         replace place2 = "NY" if (lastword=="YORK" | lastword=="Y") & place2==""
(7 real changes made)

.         replace place2 = "MA" if (lastword=="MASSACHUSETTS" | lastword=="MASS") & place2==""
(5 real changes made)

.         replace place2 = "PA" if (lastword=="PENNSYLVANIA" | lastword=="PA") & place2==""
(2 real changes made)

.         replace place2 = "NJ" if (lastword=="JERSEY" | lastword=="J") & place2==""
(4 real changes made)

.         replace place2 = "CA" if (lastword=="CALIFORNIA" | lastword=="CALIF") & place2==""
(4 real changes made)

.         replace place2 = "OH" if lastword=="OHIO" & place2==""
(0 real changes made)

.         replace place2 = "DC" if (lastword=="C" | lastword=="COLUMBIA") & place2==""
(2 real changes made)

.         replace place2 = "VA" if (lastword=="VIRGINIA" | lastword=="VA") & place2==""
(1 real change made)

.         replace place2 = "IL" if (lastword=="ILLINOIS" | lastword=="ILL") & place2==""
(3 real changes made)

.         replace place2 = "MI" if (lastword=="MICHIGAN" | lastword=="MICH") & place2==""
(0 real changes made)

.         replace place2 = "MD" if (lastword=="MARYLAND" | lastword=="MD") & place2==""
(2 real changes made)

.         replace place2 = "AL" if (lastword=="ALA" | lastword=="ALABAMA") & place2==""
(0 real changes made)

.         replace place2 = "CT" if (lastword=="CONNECTICUT" | lastword=="CONN") & place2==""
(1 real change made)

.         replace place2 = "TN" if lastword=="TENN" & place2==""
(0 real changes made)

.         replace place2 = "TX" if (lastword=="TEXAS" | lastword=="TEX") & place2==""
(0 real changes made)

.         replace place2 = "LA" if (lastword=="LOUISIANA" | lastword=="LA") & place2==""
(1 real change made)

.         replace place2 = "IN" if lastword=="INDIANA" & place2==""
(0 real changes made)

.         replace place2 = "ME" if (lastword=="MAINE" | lastword=="ME") & place2==""
(0 real changes made)

.         replace place2 = "MN" if lastword=="MINNESOTA" & place2==""
(1 real change made)

.         replace place2 = "NE" if lastword=="NEBR" & place2==""
(1 real change made)

.         replace place2 = "WI" if (lastword=="WISCONSIN" | lastword=="WIS") & place2==""
(1 real change made)

.         replace place2 = "CO" if lastword=="COLORADO" & place2==""
(0 real changes made)

.         replace place2 = "DE" if lastword=="DELAWARE" & place2==""
(0 real changes made)

.         replace place2 = "NH" if (lastword=="HAMPSHIRE" | lastword=="H") & place2==""
(2 real changes made)

.         replace place2 = "IA" if lastword=="IOWA" & place2==""
(0 real changes made)

.         replace place2 = "MO" if lastword=="MISSOURI" & place2==""
(0 real changes made)

.         replace place2 = "MS" if lastword=="MISS" & place2==""
(1 real change made)

.         replace place2 = "OR" if lastword=="OREGON" & place2==""
(0 real changes made)

.         replace place2 = "TN" if lastword=="TENNESSEE" & place2==""
(0 real changes made)

.         replace place2 = "GA" if (lastword=="GA" | lastword=="GEORGIA") & place2==""
(0 real changes made)

.         replace place2 = "FL" if (lastword=="FLORIDA" | lastword=="FLA") & place2==""
(0 real changes made)

.         replace place2 = "KY" if (lastword=="KENTUCKY" | lastword=="KY") & place2==""
(0 real changes made)

.         replace place2 = "WA" if (lastword=="WA" | lastword=="WASH") & place2==""
(0 real changes made)

. 
.         drop lastword

. 
.         count if place2==""
  170

. 
.         gen tag = 0

.         foreach s in AL AZ AR CA CO CT DE DC FL GA ID IL IN IA KS KY LA ME MD MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA RI SC SD TN TX UT VT VA WA WV WI WY {
  2.                 replace tag = 1 if place2=="`s'"
  3.         }
(89 real changes made)
(1 real change made)
(46 real changes made)
(373 real changes made)
(73 real changes made)
(132 real changes made)
(5 real changes made)
(114 real changes made)
(77 real changes made)
(108 real changes made)
(1 real change made)
(473 real changes made)
(160 real changes made)
(142 real changes made)
(4 real changes made)
(145 real changes made)
(116 real changes made)
(87 real changes made)
(144 real changes made)
(520 real changes made)
(224 real changes made)
(175 real changes made)
(64 real changes made)
(414 real changes made)
(5 real changes made)
(117 real changes made)
(0 real changes made)
(25 real changes made)
(145 real changes made)
(0 real changes made)
(1,061 real changes made)
(79 real changes made)
(0 real changes made)
(199 real changes made)
(59 real changes made)
(107 real changes made)
(535 real changes made)
(160 real changes made)
(90 real changes made)
(0 real changes made)
(123 real changes made)
(290 real changes made)
(59 real changes made)
(20 real changes made)
(262 real changes made)
(98 real changes made)
(42 real changes made)
(174 real changes made)
(2 real changes made)

.         replace place2 = "" if tag==0
(58 real changes made)

. 
.         split var1 if place2=="", p("ENLISTED") gen(temp)
variables created as string: 
temp1  temp2

.         gen lastword = word(temp2, 2)
(7,482 missing values generated)

. 
.         replace lastword = subinstr(lastword, ",", "", .)
(68 real changes made)

.         replace lastword = strtrim(lastword)
(0 real changes made)

. 
.         replace place2 = "NY" if (lastword=="YORK" | lastword=="Y") & place2==""
(1 real change made)

.         replace place2 = "MA" if (lastword=="MASSACHUSETTS" | lastword=="MASS") & place2==""
(1 real change made)

.         replace place2 = "PA" if (lastword=="PENNSYLVANIA" | lastword=="PA") & place2==""
(0 real changes made)

.         replace place2 = "NJ" if (lastword=="JERSEY" | lastword=="J") & place2==""
(0 real changes made)

.         replace place2 = "CA" if (lastword=="CALIFORNIA" | lastword=="CALIF") & place2==""
(0 real changes made)

.         replace place2 = "OH" if lastword=="OHIO" & place2==""
(0 real changes made)

.         replace place2 = "DC" if (lastword=="C" | lastword=="COLUMBIA") & place2==""
(0 real changes made)

.         replace place2 = "VA" if (lastword=="VIRGINIA" | lastword=="VA") & place2==""
(0 real changes made)

.         replace place2 = "IL" if (lastword=="ILLINOIS" | lastword=="ILL") & place2==""
(1 real change made)

.         replace place2 = "MI" if (lastword=="MICHIGAN" | lastword=="MICH") & place2==""
(0 real changes made)

.         replace place2 = "MD" if (lastword=="MARYLAND" | lastword=="MD") & place2==""
(0 real changes made)

.         replace place2 = "AL" if (lastword=="ALA" | lastword=="ALABAMA") & place2==""
(0 real changes made)

.         replace place2 = "CT" if (lastword=="CONNECTICUT" | lastword=="CONN") & place2==""
(0 real changes made)

.         replace place2 = "TN" if lastword=="TENN" & place2==""
(0 real changes made)

.         replace place2 = "TX" if (lastword=="TEXAS" | lastword=="TEX") & place2==""
(1 real change made)

.         replace place2 = "LA" if (lastword=="LOUISIANA" | lastword=="LA") & place2==""
(0 real changes made)

.         replace place2 = "IN" if (lastword=="IND" | lastword=="INDIANA") & place2==""
(1 real change made)

.         replace place2 = "ME" if (lastword=="MAINE" | lastword=="ME") & place2==""
(0 real changes made)

.         replace place2 = "MN" if (lastword=="MINN" | lastword=="MINNESOTA") & place2==""
(3 real changes made)

.         replace place2 = "NE" if lastword=="NEBR" & place2==""
(0 real changes made)

.         replace place2 = "WI" if (lastword=="WISCONSIN" | lastword=="WIS") & place2==""
(1 real change made)

.         replace place2 = "CO" if lastword=="COLORADO" & place2==""
(0 real changes made)

.         replace place2 = "DE" if lastword=="DELAWARE" & place2==""
(0 real changes made)

.         replace place2 = "NH" if (lastword=="HAMPSHIRE" | lastword=="H") & place2==""
(0 real changes made)

.         replace place2 = "IA" if lastword=="IOWA" & place2==""
(0 real changes made)

.         replace place2 = "MO" if lastword=="MISSOURI" & place2==""
(0 real changes made)

.         replace place2 = "MS" if lastword=="MISS" & place2==""
(0 real changes made)

.         replace place2 = "OR" if lastword=="OREGON" & place2==""
(0 real changes made)

.         replace place2 = "TN" if lastword=="TENNESSEE" & place2==""
(0 real changes made)

.         replace place2 = "GA" if (lastword=="GA" | lastword=="GEORGIA") & place2==""
(0 real changes made)

.         replace place2 = "FL" if (lastword=="FLORIDA" | lastword=="FLA") & place2==""
(0 real changes made)

.         replace place2 = "KY" if (lastword=="KENTUCKY" | lastword=="KY") & place2==""
(0 real changes made)

.         replace place2 = "WA" if (lastword=="WA" | lastword=="WASH") & place2==""
(0 real changes made)

.         replace place2 = "VT" if lastword=="VT" & place2==""
(0 real changes made)

. 
.         ren place2 state

. 
.         drop temp* tag

.         drop if state==""
(219 observations deleted)

. 
.         replace place1 = "" if strpos(place1, "USS")>0
(116 real changes made)

.         replace place1 = "" if strpos(place1, "USCG")>0
(42 real changes made)

.         replace place1 = "" if strpos(place1, "SECTION")>0
(2 real changes made)

.         replace place1 = "" if strpos(place1, "SHIP")>0
(4 real changes made)

.         replace place1 = "" if strpos(place1, "TRAINING")>0
(2 real changes made)

.         replace place1 = "" if strpos(place1, "SUBMARINE")>0
(2 real changes made)

.         replace place1 = "" if strpos(place1, "NAVY")>0
(14 real changes made)

.         replace place1 = "" if strpos(place1, "RECALLED")>0
(1 real change made)

.         replace place1 = "" if strpos(place1, "SHIP")>0
(0 real changes made)

.         replace place1 = "" if strpos(place1, "U S S")>0
(14 real changes made)

.         replace place1 = "" if strpos(place1, "NAVAL")>0
(9 real changes made)

.         replace place1 = "" if strpos(place1, "RECRUITING")>0
(1 real change made)

.         replace place1 = "" if strpos(place1, "AGRICULTURAL")>0
(1 real change made)

. 
.         replace var121 = subinstr(var121, "`=char(32)'", "", .)
(7,345 real changes made)

.         replace var121 = subinstr(var121, ",", " ", .)
(7,324 real changes made)

.         replace var121 = subinstr(var121, "STREET", " ", .)
(2,656 real changes made)

.         gen place1a = word(var121, -2)
(24 missing values generated)

. 
.         replace place1 = place1a if place1==""
(638 real changes made)

. 
.         replace place1 = "NEW YORK" if place1=="NEWYORK"
(25 real changes made)

. 
.         ren place1 city

.         drop place1a lastword

. 
.         split var11, p(",")
variables created as string: 
var111  var112  var113  var114  var115

.         drop var114 var115

. 
.         ren (var111 var112 var113) (surname name rank)

. 
.         * fix missing commas
.         replace rank = name if rank=="" & wordcount(surname)>1
(72 real changes made)

. 
.         gen tag = rank==""

.         replace rank = name if tag==1
variable rank was str64 now str65
(46 real changes made)

.         replace name = word(rank, 1) if name==rank & tag==1
(46 real changes made)

. 
.         replace name = word(surname, 2) + " " + word(surname, 3) if name==rank
(75 real changes made)

. 
.         replace surname = strtrim(regexr(surname, name, ""))
(61 real changes made)

. 
.         split surname, p(" OR ") limit(1)
variable created as string: 
surname1

.         replace surname = surname1
(4 real changes made)

. 
.         drop tag surname1

. 
.         gen status = ""
(7,348 missing values generated)

.         replace status = "KIA"
variable status was str1 now str3
(7,348 real changes made)

.         replace status = "Disease"      if strpos(var12, "DISEASE")>0   | ///
>                                                                    strpos(var12, "INFLUENZA")>0 | ///
>                                                                    strpos(var12, "POISON")>0
variable status was str3 now str7
(5,546 real changes made)

. 
.         replace status = "Accident" if strpos(var12, "ACCIDENT")>0      | ///
>                                                                    strpos(var12, "COLLISION")>0 | ///
>                                                                    strpos(var12, "OVERBOARD")>0 | ///
>                                                                    strpos(var12, "RAMMED")>0    | ///
>                                                                    strpos(var12, "DROWNED")>0
variable status was str7 now str8
(577 real changes made)

. 
.         replace status = "Wounds"       if strpos(var12, "DOI")>0               | ///
>                                                                    strpos(var12, "DOW")>0               | ///
>                                                                    strpos(var12, "WOUNDS")>0    | ///
>                                                                    strpos(var12, "INJUR")>0
(215 real changes made)

. 
.         gen volume = "Navy"

. 
.         keep city state surname name rank status volume

. 
.         replace volume = "4"
(7,348 real changes made)

.         destring volume, replace
volume: all characters numeric; replaced as byte

. 
.         sort surname name state

.         gen serial = _n

. 
.         compress
  variable serial was float now int
  variable city was str44 now str41
  variable state was str49 now str2
  variable surname was str38 now str20
  variable name was str65 now str31
  (764,192 bytes saved)

.         save "$path/Replication/cleaned_data/WWI Navy Casualties clean.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/WWI Navy Casualties clean.dta saved

.         clear

.         
.         
. *******************************************************************************************************************************************
. // 2) Clean location info in the WWI Casualty Lists (Army + Navy)
. *******************************************************************************************************************************************
. 
.         
.         // WWI Army Casualty Records
.         import excel "$path/Replication/raw_data/WW1 casualty list.xlsx", sheet("Sheet1") firstrow
(9 vars, 71,445 obs)

.         
.         // Append WWI Navy Casualty Records
.         append using "$path/Replication/cleaned_data/WWI Navy Casualties clean.dta"
(variable city was str26, now str41 to accommodate using data's values)
(variable surname was str17, now str20 to accommodate using data's values)
(variable name was str27, now str31 to accommodate using data's values)
(variable rank was str25, now str65 to accommodate using data's values)

.         
.         
.         // Label volume variable (Vol 1-3 Army, Vol 4 Navy even though Navy isn't actually "Vol 4" but a different source)
.         label def volnum 1 "Army Vol 1" 2 "Army Vol 2" 3 "Army Vol 3" 4 "Navy"

.         label val volume volnum

.         
.         
.         replace city = upper(city)
(71,435 real changes made)

.         
.         * get rid of special characters in the city name variable
.         qui foreach v in 33 34 39 40 42 46 47 49 51 52 54 58 59 62 63 91 93 94 95 126 128 129 131 136   ///
>                                 141 142 148 154 155 157 160 162 164 167 168 171 174 176 177 179 180 181 182 186 ///
>                                 187 188 191 194 195 208 209 226 {

.         
.         replace city = strtrim(city)
(69,866 real changes made)

.         replace city = stritrim(city)
(5 real changes made)

. 
.         * temp save of data
.         tempfile soldiers

.         save `soldiers'
file C:\Users\anf137\AppData\Local\Temp\ST_22e8_000069.tmp saved as .dta format

.         
.         
.         // generate a list of unique city/town/place names by state, assign FIPS codes and then merge the list back to the casualties
.         gen n = 1

.         
.         collapse (sum) n, by(state city)

.         
.         * statenames
.         qui strrec state        ("AL" = "ALABAMA")                      ("AK" = "ALASKA")               ("AZ" = "ARIZONA")              ("AR" = "ARKANSAS")             ///
>                                                 ("CA" = "CALIFORNIA")           ("CO" = "COLORADO")     ("CT" = "CONNECTICUT")  ("DE" = "DELAWARE")             ///
>                                                 ("FL" = "FLORIDA")                      ("GA" = "GEORGIA")              ("HI" = "HAWAII")               ("ID" = "IDAHO")                        ///
>                                                 ("IL" = "ILLINOIS")             ("IN" = "INDIANA")              ("IA" = "IOWA")                 ("KS" = "KANSAS")                       ///
>                                                 ("KY" = "KENTUCKY")             ("LA" = "LOUISIANA")    ("ME" = "MAINE")                ("MD" = "MARYLAND")             ///
>                                                 ("MA" = "MASSACHUSETTS")        ("MI" = "MICHIGAN")     ("MN" = "MINNESOTA")    ("MS" = "MISSISSIPPI")          ///
>                                                 ("MO" = "MISSOURI")             ("MT" = "MONTANA")              ("NE" = "NEBRASKA")     ("NV" = "NEVADA")                       ///
>                                                 ("NH" = "NEW HAMPSHIRE")        ("NJ" = "NEW JERSEY")   ("NM" = "NEW MEXICO")   ("NY" = "NEW YORK")             ///
>                                                 ("NC" = "NORTH CAROLINA")       ("ND" = "NORTH DAKOTA") ("OH" = "OHIO")                 ("OK" = "OKLAHOMA")             ///
>                                                 ("OR" = "OREGON")                       ("PA" = "PENNSYLVANIA") ("RI" = "RHODE ISLAND") ("SC" = "SOUTH CAROLINA")       ///
>                                                 ("SD" = "SOUTH DAKOTA")         ("TN" = "TENNESSEE")    ("TX" = "TEXAS")                ("UT" = "UTAH")                         ///
>                                                 ("VT" = "VERMONT")                      ("VA" = "VIRGINIA")     ("WA" = "WASHINGTON")   ("WV" = "WEST VIRGINIA")        ///
>                                                 ("WI" = "WISCONSIN")            ("WY" = "WYOMING")              ("DC" = "DISTRICT OF COLUMBIA"),                                        ///
>                                                 gen(STATE)

.         
.         * city name id
.         gen idm = _n

.                                                         
.         ren city name

.         
.         replace name = subinstr(name, "ST.", "SAINT", .)
(0 real changes made)

.         replace name = subinstr(name, "NORTH", "", .)
(177 real changes made)

.         replace name = subinstr(name, "SOUTH", "", .)
(185 real changes made)

.         replace name = subinstr(name, "WEST", "", .)
(289 real changes made)

.         replace name = subinstr(name, "EAST", "", .)
(193 real changes made)

.         
.         replace name = strtrim(name)
(661 real changes made)

.         replace name = stritrim(name)
(1 real change made)

.         
.         tempfile maindata

.         save `maindata'
file C:\Users\anf137\AppData\Local\Temp\ST_22e8_00006a.tmp saved as .dta format

.         
.         * match city names with the geonames.org list by state
.         qui foreach s of local statelvl {

.         
.         clear

.         
.         * append all single state files
.         qui foreach s of local statelvl {

.         
.         * assess match quality using bi-gram
.         matchit name name1, gen(score_bi)
Matching columns name and name1
Similarity function: bigram
0%
20%
40%
60%
80%
Done!

.         
.         * mark best match
.         egen double maxscore = max(score_bi), by(idm)

.         keep if score_bi==maxscore
(86,797 observations deleted)

.         
.         * merge back main data to city list
.         merge m:1 idm using `maindata'
(variable name was str40, now str41 to accommodate using data's values)
(variable idm was int, now float to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                         1,178
        from master                         0  (_merge==1)
        from using                      1,178  (_merge==2)

    Matched                            29,692  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(1,178 observations deleted)

.         drop _merge

.         
.         * place info from geonames.org
.         merge m:1 id using "$path/Replication/raw_data/geonamesorg_places_1910.dta"
(variable name was str41, now str67 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                       166,959
        from master                         0  (_merge==1)
        from using                    166,959  (_merge==2)

    Matched                            29,692  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(166,959 observations deleted)

.         drop _merge

.         
.         * county info from Census
.         ren icpsrfip fips

.         merge m:1 fips using "$path/Replication/raw_data/1910census_county.dta", keepusing(totpop)

    Result                      Number of obs
    -----------------------------------------
    Not matched                           120
        from master                         8  (_merge==1)
        from using                        112  (_merge==2)

    Matched                            29,684  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(112 observations deleted)

.         drop _merge

.         
.         drop if name==""
(0 observations deleted)

.         
.         * for duplicates, take the place in the county with the highest pop
.         egen maxpop = max(totpop), by(name state)
(5 missing values generated)

.         
.         keep if totpop==maxpop
(4,216 observations deleted)

.         duplicates drop name state, force

Duplicates in terms of name state

(2,896 observations deleted)

.         
.         * keep relevant variables
.         keep id idm name state STATE icpsrst icpsrcty icpsrnam statenam icpsrsti icpsrctyi fips gisjoin

.         
.         ren name city

.         
.         * save the geolocated city list as temp file
.         compress
  variable idm was float now int
  variable city was str67 now str40
  variable icpsrnam was str32 now str17
  (993,520 bytes saved)

.         tempfile citylist

.         save `citylist'
file C:\Users\anf137\AppData\Local\Temp\ST_22e8_000097.tmp saved as .dta format

.         clear

.         
.         
.         // bring back the soldier data                          
.         use `soldiers'

.         
.         * merge with geolocated city list
.         merge m:1 city state using `citylist'

    Result                      Number of obs
    -----------------------------------------
    Not matched                         3,772
        from master                     3,434  (_merge==1)
        from using                        338  (_merge==2)

    Matched                            75,359  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(338 observations deleted)

.         
.         drop STATE

.         
.         * code the statenames again
.         qui strrec state        ("AL" = "ALABAMA")                      ("AK" = "ALASKA")               ("AZ" = "ARIZONA")              ("AR" = "ARKANSAS")             ///
>                                                 ("CA" = "CALIFORNIA")           ("CO" = "COLORADO")     ("CT" = "CONNECTICUT")  ("DE" = "DELAWARE")             ///
>                                                 ("FL" = "FLORIDA")                      ("GA" = "GEORGIA")              ("HI" = "HAWAII")               ("ID" = "IDAHO")                        ///
>                                                 ("IL" = "ILLINOIS")             ("IN" = "INDIANA")              ("IA" = "IOWA")                 ("KS" = "KANSAS")                       ///
>                                                 ("KY" = "KENTUCKY")             ("LA" = "LOUISIANA")    ("ME" = "MAINE")                ("MD" = "MARYLAND")             ///
>                                                 ("MA" = "MASSACHUSETTS")        ("MI" = "MICHIGAN")     ("MN" = "MINNESOTA")    ("MS" = "MISSISSIPPI")          ///
>                                                 ("MO" = "MISSOURI")             ("MT" = "MONTANA")              ("NE" = "NEBRASKA")     ("NV" = "NEVADA")                       ///
>                                                 ("NH" = "NEW HAMPSHIRE")        ("NJ" = "NEW JERSEY")   ("NM" = "NEW MEXICO")   ("NY" = "NEW YORK")             ///
>                                                 ("NC" = "NORTH CAROLINA")       ("ND" = "NORTH DAKOTA") ("OH" = "OHIO")                 ("OK" = "OKLAHOMA")             ///
>                                                 ("OR" = "OREGON")                       ("PA" = "PENNSYLVANIA") ("RI" = "RHODE ISLAND") ("SC" = "SOUTH CAROLINA")       ///
>                                                 ("SD" = "SOUTH DAKOTA")         ("TN" = "TENNESSEE")    ("TX" = "TEXAS")                ("UT" = "UTAH")                         ///
>                                                 ("VT" = "VERMONT")                      ("VA" = "VIRGINIA")     ("WA" = "WASHINGTON")   ("WV" = "WEST VIRGINIA")        ///
>                                                 ("WI" = "WISCONSIN")            ("WY" = "WYOMING")              ("DC" = "DISTRICT OF COLUMBIA"),                                        ///
>                                                 gen(STATE)

.         
.                 
.         preserve

. 
.         * temporarily save the current data, then look for additional matches for cities that were not in the citylist file
.         tempfile tempmatch

.         save `tempmatch'
file C:\Users\anf137\AppData\Local\Temp\ST_22e8_000099.tmp saved as .dta format

.         restore

. 
.         
.         * look at unmatched cities
.         keep if _merge==1
(75,359 observations deleted)

.         drop idm- gisjoin

.         
.         replace city = subinstr(city, "ST ", "SAINT ", .) if word(city, 1)=="ST"
(50 real changes made)

.                 
.         keep if _merge==1
(0 observations deleted)

.         gen n = 1

.         
.         egen sumn = sum(n), by(city state)

.         duplicates drop city state, force

Duplicates in terms of city state

(1,499 observations deleted)

.         
.         * list the most frequently appearing unmatched cities
.         gsort -sumn city state

.         ren _merge merge1

.         
.         gen idm = _n

. 
.         * use NHGIS city list as additional source to geolocated the unmatched cities
.         reclink2 city STATE using "$path/Replication/raw_data/placenames1910.dta", idm(idm) idu(_ID) required(STATE) gen(score)

236 perfect matches found

Going through 1699 observation to assess fuzzy matches, each .=5% complete
....................
Added: _ID= identifier from C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/raw_data/placenames1910.dta   score = matching score
Observations:  Master N = 1935    C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/raw_data/placenames1910.dta N= 14081 
  Unique Master Cases: matched = 1371 (exact = 236), unmatched = 564

.         
.         drop if city==""
(4,055 observations deleted)

.         
.         * compute bi-gram score to check match quality between WW1 city and the matched NHGIS city
.         matchit city Ucity, gen(score_bi)
Matching columns city and Ucity
Similarity function: bigram
0%
20%
40%
60%
80%
Done!

.         
.         * keep best match
.         egen double maxscore = max(score_bi), by(idm)

.         keep if score_bi==maxscore
(17 observations deleted)

.         drop if score_bi<0.6
(1,042 observations deleted)

.         
.         duplicates drop city STATE, force

Duplicates in terms of city STATE

(11 observations deleted)

.         
.         keep if _merge==3
(0 observations deleted)

.         drop _merge

. 
.         * save the previously unmatched cities that are now geocoded
.         tempfile placematch

.         save `placematch'
file C:\Users\anf137\AppData\Local\Temp\ST_22e8_00009a.tmp saved as .dta format

.         clear

. 
.         
.         * and merge it back to our previous soldier data
.         use `tempmatch'

.         ren _merge merge1

.         
.         merge m:1 city STATE using `placematch'
(variable idm was int, now float to accommodate using data's values)
(label volnum already defined)
(label _merge already defined)

    Result                      Number of obs
    -----------------------------------------
    Not matched                        76,717
        from master                    76,702  (_merge==1)
        from using                         15  (_merge==2)

    Matched                             2,091  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(15 observations deleted)

.         ren _merge merge2

.         
.         gen placefips = substr(NHGISPLACE, 5, 5)
(76,702 missing values generated)

.         
.         merge m:1 placefips state using "$path/Replication/raw_data/county_place_ids.dta"
(variable city was str41, now str57 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                       113,040
        from master                    76,923  (_merge==1)
        from using                     36,117  (_merge==2)

    Matched                             1,870  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(36,117 observations deleted)

.         drop _merge

.         
.         gen fips2 = statefips + countyfips
(76,923 missing values generated)

.         destring fips2, replace
fips2: all characters numeric; replaced as long
(76923 missing values generated)

.         
.         replace fips = fips2 if fips==. & fips2!=.
(1,870 real changes made)

.         
.         keep serial- volume fips

.         
.         
.         * some manual fixes (I hand-coded places with >3 soldiers)
.         
.                 // West Hoboken (merged with Union Hill into Union City) and North Bergen in Hudson County, NJ 
.                 replace fips = 34017 if city=="WEST HOBOKEN" & fips==. & state=="NJ"
(23 real changes made)

.                 replace fips = 34017 if city=="NORTH BERGEN" & fips==. & state=="NJ"
(9 real changes made)

.                 
.                 // South and West Orange, and Peabody in Essex County, NJ
.                 replace fips = 34017 if city=="WEST ORANGE" & fips==. & state=="NJ"
(23 real changes made)

.                 replace fips = 34017 if city=="SOUTH ORANGE" & fips==. & state=="NJ"
(6 real changes made)

.                 replace fips = 34017 if city=="PEAHODY" & fips==. & state=="NJ"
(0 real changes made)

.                 replace city = "PEABODY" if city=="PEAHODY"
(4 real changes made)

.                 
.                 // Westerly in Washington County, RI
.                 replace fips = 44009 if city=="WESTERLY" & fips==. & state=="RI"
(10 real changes made)

.         
.                 // Westfield in Hampden County, MA
.                 replace fips = 25013 if city=="WESTFIELD" & fips==. & state=="MA"
(10 real changes made)

.                 
.                 // Manchester in Hartford County, CT
.                 replace fips = 9003 if city=="SOUTH MANCHESTER" & fips==. & state=="CT"
(9 real changes made)

.                 
.                 // St Albans in Franklin County, VT
.                 replace fips = 50011 if city=="ST ALBANS" & fips==. & state=="VT"
(9 real changes made)

.                 
.                 // Southbridge in Worcester County, MA
.                 replace fips = 25027 if city=="SOUTHBRIDGE" & fips==. & state=="MA"
(8 real changes made)

.                 
.                 // North Yakima in Yakima County, WA
.                 replace fips = 53077 if city=="NORTH YAKIMA" & fips==. & state=="WA"
(7 real changes made)

.                 
.                 // St Joseph in Berrien County, MI
.                 replace fips = 26021 if city=="ST JOSEPH" & fips==. & state=="MI"
(8 real changes made)

.                 
.                 // North Attleboro in Bristol County, MA
.                 replace fips = 25005 if city=="NORTH ATTLEBORO" & fips==. & state=="MA"
(6 real changes made)

.                 
.                 // Troy in Rensselaer County, NY
.                 replace fips = 36083 if city=="NORTH TROY" & fips==. & state=="NY"
(6 real changes made)

.                 
.                 // South Norwalk in Fairfield County, CT
.                 replace fips = 9001 if city=="SOUTH NORWALK" & fips==. & state=="CT"
(7 real changes made)

.                 
.                 // West Roxbury in Suffolk County, MA
.                 replace fips = 25025 if city=="WEST ROXBURY" & fips==. & state=="MA"
(6 real changes made)

.                 
.                 // Dryden in Harmon County, OK
.                 replace fips = 40057 if city=="DRYDEN" & fips==. & state=="OK"
(5 real changes made)

.                 
.                 // East Greenwich in Kent County, RI
.                 replace fips = 44003 if city=="EAST GREENWICH" & fips==. & state=="RI"
(5 real changes made)

.                 
.                 // Fargo in Cass County, ND
.                 replace fips = 38017 if city=="NORTH FARGO" & fips==. & state=="ND"
(5 real changes made)

.                 
.                 // South Haven in Allegan County, MI
.                 replace fips = 26005 if city=="SOUTH HAVEN" & fips==. & state=="MI"
(5 real changes made)

.                 
.                 // West Bridgewater in Plymouth County, MA
.                 replace fips = 25023 if city=="WEST BRIDGEWATER" & fips==. & state=="MA"
(5 real changes made)

.                 
.                 // Bryan in Brazos County, TX
.                 replace fips = 48041 if city=="BRVAN" & fips==. & state=="TX"
(4 real changes made)

.                 replace city = "BRYAN" if city=="BRVAN" & state=="TX"
(4 real changes made)

.                 
.                 // Akron in Summit County, OH
.                 replace fips = 39153 if city=="EAST AKRON" & fips==. & state=="OH"
(4 real changes made)

.                 
.                 // East Milton and South Weymouth in Norfolk County, MA 
.                 replace fips = 25021 if city=="EAST MILTON" & fips==. & state=="MA"
(4 real changes made)

.                 replace fips = 25021 if city=="SOUTH WEYMOUTH" & fips==. & state=="MA"
(4 real changes made)

.                 
.                 // Easthampton in Hampshire County, MA 
.                 replace fips = 25015 if city=="EASTHAMPTON" & fips==. & state=="MA"
(4 real changes made)

.                 
.                 // North English in Iowa County, IA
.                 replace fips = 19095 if city=="NORTH ENGLISH" & fips==. & state=="IA"
(4 real changes made)

.                 
.                 // Northfild in Dakota County, MN
.                 replace fips = 27037 if city=="NORTHFIELD" & fips==. & state=="MN"
(4 real changes made)

.                 
.                 // Northville in Oakland County, MI
.                 replace fips = 26125 if city=="NORTHVILLE" & fips==. & state=="MI"
(4 real changes made)

.                 
.                 // Westside in Crawford County, IA
.                 replace fips = 19047 if city=="WEST SIDE" & fips==. & state=="IA"
(4 real changes made)

.                 
.                 
.         
.         tostring fips, gen(fipstemp)
fipstemp generated as str7

.         
.         gen statefips = substr(fipstemp, 1, 2)

.         gen countyfips = substr(fipstemp, 3, 3)
(1,371 missing values generated)

.         drop fipstemp

.                 
.                 
. *******************************************************************************************************************************************
. // 3) Clean names
. *******************************************************************************************************************************************
.                 
.         // clean first (and middle) name
.         
.         replace name = upper(name)
(71,254 real changes made)

.         replace surname = upper(surname)
(1,966 real changes made)

.         
.         qui foreach v in 33 34 38 39 40 41 42 44 45 46 47 48 49 51 54 57 58 59 62 63 92 93 94 95 125    ///
>                                 126 128 129 130 131 137 139 141 146 147 148 154 157 158 159 161 162 163 165 167         ///
>                                 168 171 173 175 176 187 191 194 195 208 209 226 {

.         
.         replace name = subinstr(name, "[RIGHT", "", .)
(10 real changes made)

.         
.         replace name = strtrim(name)
(77,657 real changes made)

.         replace name = stritrim(name)
(30 real changes made)

.         
.         * replace some common name abbreviations with the actual name
.         qui foreach i in 1 2 {

. 
.         
.         // save individual level data
.         compress
  variable name was str31 now str29
  variable city was str57 now str40
  (1,497,067 bytes saved)

.         save "$path/Replication/cleaned_data/WWI casualties Army Navy clean.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/WWI casualties Army Navy clean.dta saved

.         
.         // save county level data
.         gen n = 1

. 
.         egen dead_all = sum(n), by(fips)

.         egen dead_acc = sum(n) if status=="Accident", by(fips)
(74,823 missing values generated)

.         egen dead_dis = sum(n) if status=="Disease", by(fips)
(51,189 missing values generated)

.         egen dead_kia = sum(n) if status=="KIA", by(fips)
(45,054 missing values generated)

.         egen dead_wnd = sum(n) if status=="Wounds", by(fips)
(65,313 missing values generated)

.         
.         collapse dead_*, by(fips)

.         
.         drop if fips==0
(1 observation deleted)

.         mvencode _all, mv(0) over
        fips: 1 missing value recoded
    dead_acc: 1596 missing values recoded
    dead_dis: 184 missing values recoded
    dead_kia: 198 missing values recoded
    dead_wnd: 638 missing values recoded

.         
.         compress
  variable dead_all was float now int
  variable dead_acc was float now int
  variable dead_dis was float now int
  variable dead_kia was float now int
  variable dead_wnd was float now int
  (28,810 bytes saved)

.         save "$path/Replication/cleaned_data/WWI casualties Army Navy clean - county.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/WWI casualties Army Navy clean - county.dta saved

. 
end of do-file

.         
.         * 1.B - Clean the draft data
.         do "$path/Replication/1.B - Clean WW1 Enlistment Data.do"

. clear all

. capture set more off

. 
. *******************************************************************************************************************************************
. // Admin
. *******************************************************************************************************************************************
. /*
>         // Set directory path
>         foreach i in "C:/Users/Andy/Dropbox/projects/WWI German Discrimination"         ///
>                                  "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"   ///
>                                  "Z:/Dropbox/projects/WWI German Discrimination"                                {
>                 
>                                 global path "`i'"
>                                 confirmdir "$path"
>                                 if `r(confirmdir)'==0 continue, break
>         }
> */
. *******************************************************************************************************************************************
. 
. 
. * prep the 1910 county level statistics for merge later
.         use "$path/Replication/raw_data/1910census_county.dta"
(Historical, Demographic, Economic, and Social Data: The United States, 1790-2002)

. 
.         keep if level==1
(51 observations deleted)

. 
.         tempfile c1910

.         save "`c1910'"
file C:\Users\anf137\AppData\Local\Temp\ST_22e8_000001.tmp saved as .dta format

.         clear

. 
. * clean the digitized enlistment data
. 
.         * load raw data
.         import excel "$path/Replication/raw_data/WWI inductions by county.xlsx", sheet("Sheet1") firstrow
(8 vars, 4,634 obs)

. 
.         * remove special characters and excess spaces
.         ds, has(type string)
board         tot_called    tot_inducted  tot_accepted  tot_rejected  tot_cancel~d  statename

.         foreach v in `r(varlist)' {
  2.                 replace `v' = strtrim(`v')
  3.                 replace `v' = stritrim(`v')
  4.         }
(2,899 real changes made)
(902 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

. 
.         * format numbers
.         replace tot_cancelled = subinstr(tot_cancelled, "I", "1", .)
(14 real changes made)

. 
.         gen tot_called_num    = real(regexs(1)) if regexm(tot_called   ,"([0-9]+)")
(40 missing values generated)

.         gen tot_inducted_num  = real(regexs(1)) if regexm(tot_inducted ,"([0-9]+)")
(5 missing values generated)

.         gen tot_accepted_num  = real(regexs(1)) if regexm(tot_accepted ,"([0-9]+)")
(5 missing values generated)

.         gen tot_rejected_num  = real(regexs(1)) if regexm(tot_rejected ,"([0-9]+)")
(39 missing values generated)

.         gen tot_cancelled_num = real(regexs(1)) if regexm(tot_cancelled,"([0-9]+)")
(2,125 missing values generated)

.         compress
  variable tot_rejected_num was float now int
  variable tot_cancelled_num was float now int
  variable board was str55 now str22
  (171,458 bytes saved)

. 
.         mvencode *_num, mv(0) override
tot_called~m: 40 missing values recoded
tot_induct~m: 5 missing values recoded
tot_accept~m: 5 missing values recoded
tot_reject~m: 39 missing values recoded
tot_cancel~m: 2125 missing values recoded

. 
.         * check for errors
.         gen check_inducted = tot_accepted_num + tot_rejected_num + tot_cancelled_num

. 
.         gen error = check_inducted - tot_inducted_num

. 
.         * drop state sums
.         drop if board=="Total" | board=="Totel"
(51 observations deleted)

. 
.         * clean board/county variable, make upper case, remove special characters
.         gen name = board

.         split name, p("No ")
variables created as string: 
name1  name2

.         replace name = name1
(1,685 real changes made)

.         drop name1 name2

. 
.         replace name = upper(name)
(4,566 real changes made)

. 
.         foreach i in 40 41 45 48 49 50 51 52 53 54 55 56 57 58 59 128 153 226 {
  2.                 replace name = subinstr(name, "`=char(`i')'", "", .)
  3.         }
(4 real changes made)
(4 real changes made)
(4 real changes made)
(2 real changes made)
(12 real changes made)
(9 real changes made)
(3 real changes made)
(3 real changes made)
(3 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)
(2 real changes made)
(1 real change made)
(2 real changes made)
(1 real change made)
(1 real change made)
(1 real change made)

. 
.         replace name = strtrim(name)
(1,702 real changes made)

. 
.         * merge with state identifiers
.         merge m:1 statefips using "$path/Replication/raw_data/statefips.dta"
(variable statename was str14, now str20 to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                             2
        from master                         1  (_merge==1)
        from using                          1  (_merge==2)

    Matched                             4,582  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(1 observation deleted)

.         drop _merge

. 
.         * drop Alaska and Hawaii
.         drop if statename=="Alaska" | statename=="Hawaii"
(28 observations deleted)

. 
.         * remove numbering of boards
.         split board if board!="Del Norte", p(" No")
variables created as string: 
board1  board2

.         replace board = board1 if board!=board1
(1,670 real changes made)

. 
.         drop board1 board2

. 
.         ren stateicp state

. 
.         * merge with 1910 census on name and state (this merges most of the county codes)
.         merge m:1 name state using "`c1910'", keepusing(county)
(variable state was byte, now int to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                         1,036
        from master                       901  (_merge==1)
        from using                        135  (_merge==2)

    Matched                             3,654  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(135 observations deleted)

. 
.         
. * now take care for places with typos or which are cities (instead of counties, hence they don't match w 1910 census)
. 
. * DC
. replace county =  10 if statefips==11
(11 real changes made)

. 
. * Alabama
. replace county =  730 if board=="Birmingham"            & statefips==1
(6 real changes made)

. replace county =  150 if board=="Calhoun"                       & statefips==1
(1 real change made)

. replace county =  210 if board=="Chilton"                       & statefips==1
(1 real change made)

. replace county =  490 if board=="Dekalb"                        & statefips==1
(1 real change made)

. replace county =  750 if board=="Lamar"                         & statefips==1
(1 real change made)

. replace county = 1030 if board=="Morgan"                        & statefips==1
(1 real change made)

. replace county = 1330 if board=="Winston"                       & statefips==1
(1 real change made)

. 
. * Arizona
. replace county =   30 if board=="Cohise"                        & statefips==4
(1 real change made)

. replace county =  110 if board=="Greenlee"                      & statefips==4
(1 real change made)

.         
. * Arkansas
. replace county =  590 if board=="Hot Springs"           & statefips==5
(1 real change made)

. replace county = 1190 if board=="Little Rock"           & statefips==5
(2 real changes made)

. replace county = 1230 if board=="St Frances"            & statefips==5
(1 real change made)

. 
. * California
. replace county =   10 if board=="Berkeley"                      & statefips==6
(2 real changes made)

. replace county =  190 if board=="Fresno (city)"         & statefips==6
(1 real change made)

. replace county =  190 if board=="Fresno (county)"       & statefips==6
(2 real changes made)

. replace county =   10 if board=="Oakland"                       & statefips==6
(7 real changes made)

. replace county =  370 if board=="Pasadena"                      & statefips==6
(2 real changes made)

. replace county =  850 if board=="San Jose"                      & statefips==6
(1 real change made)

. replace county =  990 if board=="Stanislau"                     & statefips==6
(1 real change made)

. replace county =  770 if board=="Stockton"                      & statefips==6
(1 real change made)

. 
. * Colorado
. replace county =   30 if board=="Alamosa"                       & statefips==8
(1 real change made)

. replace county =  410 if board=="Colorado Springs"      & statefips==8
(1 real change made)

. replace county =  250 if board=="Crowley"                       & statefips==8
(1 real change made)

. replace county =  810 if board=="Moffat"                        & statefips==8
(1 real change made)

. 
. * Connceticut
. replace county =   10 if board=="Bridgeport"            & statefips==9
(6 real changes made)

. replace county =   30 if board=="New Britain"           & statefips==9
(2 real changes made)

. replace county =   10 if board=="Stamford"                      & statefips==9
(1 real change made)

. replace county =   90 if board=="Waterbury"                     & statefips==9
(3 real changes made)

. 
. * Delaware
. replace county =   30 if board=="Wilmington"            & statefips==10
(4 real changes made)

. 
. * Florida
. replace county =   50 if board=="Bay"                           & statefips==12
(1 real change made)

. replace county =   70 if board=="Bradford"                      & statefips==12
(1 real change made)

. replace county =   90 if board=="Brevard"                       & statefips==12
(1 real change made)

. replace county =  110 if board=="Broward"                       & statefips==12
(1 real change made)

. replace county =  350 if board=="Flagler"                       & statefips==12
(1 real change made)

. replace county =  530 if board=="Hernando"                      & statefips==12
(1 real change made)

. replace county =  310 if board=="Jacksonville"          & statefips==12
(3 real changes made)

. replace county =  910 if board=="Okaloosa"                      & statefips==12
(1 real change made)

. replace county =  930 if board=="Okeechobee"            & statefips==12
(1 real change made)

. replace county =  950 if board=="Orange"                        & statefips==12
(1 real change made)

. replace county = 1010 if board=="Pascoe"                        & statefips==12
(1 real change made)

. replace county = 1030 if board=="Pinellas"                      & statefips==12
(1 real change made)

. replace county = 1170 if board=="Seminole"                      & statefips==12
(1 real change made)

. replace county =  570 if board=="Tampa"                         & statefips==12
(2 real changes made)

. 
. * Georgia
. replace county = 1210 if board=="Atlanta"                       & statefips==13
(7 real changes made)

. replace county = 2450 if board=="Augusta"                       & statefips==13
(2 real changes made)

. replace county =   50 if board=="Bacon"                         & statefips==13
(1 real change made)

. replace county =  130 if board=="Barrow"                        & statefips==13
(1 real change made)

. replace county =  150 if board=="Bartow"                        & statefips==13
(1 real change made)

. replace county =  230 if board=="Bleckley"                      & statefips==13
(1 real change made)

. replace county =  430 if board=="Candler"                       & statefips==13
(1 real change made)

. replace county =  530 if board=="Chattaoochee"          & statefips==13
(1 real change made)

. replace county =  890 if board=="Dekalb"                        & statefips==13
(1 real change made)

. replace county = 1070 if board=="Emmanuel"                      & statefips==13
(1 real change made)

. replace county = 1090 if board=="Evans"                         & statefips==13
(1 real change made)

. replace county = 1250 if board=="Glasscock"                     & statefips==13
(1 real change made)

. replace county = 2210 if board=="Oglethrope"            & statefips==13
(1 real change made)

. replace county =  510 if board=="Savannah"                      & statefips==13
(2 real changes made)

. replace county = 3090 if board=="Wheeler"                       & statefips==13
(1 real change made)

. 
. * Idaho
. replace county =   30 if board=="Adams"                         & statefips==16
(1 real change made)

. replace county =   90 if board=="Benewah"                       & statefips==16
(1 real change made)

. replace county =  190 if board=="Bonneville"            & statefips==16
(1 real change made)

. replace county =  210 if board=="Boundary"                      & statefips==16
(1 real change made)

. replace county =  230 if board=="Butte"                         & statefips==16
(1 real change made)

. replace county =  250 if board=="Camas"                         & statefips==16
(1 real change made)

. replace county =  350 if board=="Clearwater"            & statefips==16
(1 real change made)

. replace county =  410 if board=="Franklin"                      & statefips==16
(1 real change made)

. replace county =  450 if board=="Gem"                           & statefips==16
(1 real change made)

. replace county =  470 if board=="Gooding"                       & statefips==16
(1 real change made)

. replace county =  510 if board=="Jefferson"                     & statefips==16
(1 real change made)

. replace county =  610 if board=="Lewis"                         & statefips==16
(1 real change made)

. replace county =  650 if board=="Madison"                       & statefips==16
(1 real change made)

. replace county =  670 if board=="Minidoka"                      & statefips==16
(1 real change made)

. replace county =  750 if board=="Payette"                       & statefips==16
(1 real change made)

. replace county =  770 if board=="Power"                         & statefips==16
(1 real change made)

. replace county =  810 if board=="Teton"                         & statefips==16
(1 real change made)

. replace county =  850 if board=="Valley"                        & statefips==16
(1 real change made)

. 
. * Illinois
. replace county =  430 if board=="Aurora"                        & statefips==17
(1 real change made)

. replace county =  310 if board=="Chicago"                       & statefips==17
(86 real changes made)

. replace county = 1830 if board=="Danville"                      & statefips==17
(1 real change made)

. replace county = 1150 if board=="Decatur"                       & statefips==17
(1 real change made)

. replace county =  390 if board=="Dewitt"                        & statefips==17
(1 real change made)

. replace county =  430 if board=="Dupage"                        & statefips==17
(1 real change made)

. replace county = 1190 if board=="East St Louis"         & statefips==17
(3 real changes made)

. replace county =  930 if board=="Joliet"                        & statefips==17
(1 real change made)

. replace county =   10 if board=="Quincy"                        & statefips==17
(1 real change made)

. replace county = 2010 if board=="Rockford"                      & statefips==17
(2 real changes made)

. replace county = 1670 if board=="Springfield"           & statefips==17
(2 real changes made)

. replace county = 1630 if board=="St Clar"                       & statefips==17
(2 real changes made)

. 
. * Indiana
. replace county =  330 if board=="Dekalb"                        & statefips==18
(1 real change made)

. replace county = 1630 if board=="EVANSVILLE"            & statefips==18
(3 real changes made)

. replace county =  890 if board=="East chicago"          & statefips==18
(1 real change made)

. replace county =   30 if board=="Fort Wayne"            & statefips==18
(3 real changes made)

. replace county =  890 if board=="Gary"                          & statefips==18
(3 real changes made)

. replace county =  970 if board=="Indianapolis"          & statefips==18
(10 real changes made)

. replace county = 1410 if board=="South Bend"            & statefips==18
(2 real changes made)

. replace county = 1670 if board=="Terre Haute"           & statefips==18
(2 real changes made)

. replace county = 1650 if board=="Vermilion"                     & statefips==18
(1 real change made)

. 
. * Iowa
. replace county =  130 if board=="Blackhawk"                     & statefips==19
(1 real change made)

. replace county = 1130 if board=="Cedar rapids"          & statefips==19
(1 real change made)

. replace county = 1550 if board=="Council Bluffs"        & statefips==19
(1 real change made)

. replace county = 1630 if board=="Davenport"                     & statefips==19
(2 real changes made)

. replace county = 1190 if board=="Lyon"                          & statefips==19
(1 real change made)

. replace county = 1410 if board=="O’Brien"                     & statefips==19
(1 real change made)

. replace county = 1930 if board=="Sioux City"            & statefips==19
(2 real changes made)

. replace county =  130 if board=="Waterloo"                      & statefips==19
(1 real change made)

. 
. * Kansas
. replace county =  170 if board=="Chaste"                        & statefips==20
(1 real change made)

. replace county =  210 if board=="Cherokee"                      & statefips==20
(1 real change made)

. replace county =  410 if board=="Dickenson"                     & statefips==20
(1 real change made)

. replace county = 2090 if board=="Kansas City"           & statefips==20
(4 real changes made)

. replace county = 1210 if board=="Miami"                         & statefips==20
(1 real change made)

. replace county = 1330 if board=="Neosho"                        & statefips==20
(1 real change made)

. replace county = 1690 if board=="Salina"                        & statefips==20
(1 real change made)

. replace county = 1770 if board=="Topeka"                        & statefips==20
(2 real changes made)

. 
. * Kentucky
. replace county = 1170 if board=="COVINGTON"                     & statefips==21
(2 real changes made)

. replace county =  670 if board=="Lexington"                     & statefips==21
(1 real change made)

. replace county = 1110 if board=="Louisville"            & statefips==21
(7 real changes made)

. replace county = 1470 if board=="McCreary"                      & statefips==21
(1 real change made)

. replace county =  370 if board=="Newport"                       & statefips==21
(1 real change made)

. 
. * Louisiana
. replace county =   30 if board=="Allen"                                 & statefips==22
(1 real change made)

. replace county =  110 if board=="Beauregard"                    & statefips==22
(1 real change made)

. replace county =  390 if board=="Evangeline"                    & statefips==22
(1 real change made)

. replace county =  530 if board=="Jefferson Davis"               & statefips==22
(1 real change made)

. replace county =  710 if board=="New Orleans"                   & statefips==22
(13 real changes made)

. replace county =  170 if board=="Shreveport"                    & statefips==22
(1 real change made)

. replace county =  950 if board=="St John the Baptist"   & statefips==22
(1 real change made)

. replace county = 1130 if board=="Vermilion"                             & statefips==22
(1 real change made)

. 
. * Maine
. replace county =   50 if board=="Portland"                      & statefips==23
(2 real changes made)

. 
. * Massachusetts
. replace county =   30 if board=="Adams"                         & statefips==25
(1 real change made)

. replace county =  150 if board=="Amherst"                       & statefips==25
(1 real change made)

. replace county =  170 if board=="Arlington"                     & statefips==25
(1 real change made)

. replace county =  270 if board=="Athol"                         & statefips==25
(1 real change made)

. replace county =   50 if board=="Attleboro"                     & statefips==25
(1 real change made)

. replace county =  170 if board=="Ayer"                          & statefips==25
(1 real change made)

. replace county =  170 if board=="Belmont"                       & statefips==25
(1 real change made)

. replace county =   90 if board=="Beverly"                       & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 1"                      & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 10"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 11"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 12"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 13"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 14"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 15"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 16"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 17"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 18"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 19"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 2"                      & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 20"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 21"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 22"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 23"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 24"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 25"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 3"                      & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 4"                      & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 5"                      & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 6"                      & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 7"                      & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 8"                      & statefips==25
(1 real change made)

. replace county =  250 if board=="Boston 9"                      & statefips==25
(1 real change made)

. replace county =  230 if board=="Brockton"                      & statefips==25
(2 real changes made)

. replace county =  210 if board=="Brookline"                     & statefips==25
(1 real change made)

. replace county =  170 if board=="Cambridge"                     & statefips==25
(4 real changes made)

. replace county =  210 if board=="Canton"                        & statefips==25
(1 real change made)

. replace county =  250 if board=="Chelsea"                       & statefips==25
(2 real changes made)

. replace county =  130 if board=="Chicopee"                      & statefips==25
(1 real change made)

. replace county =  230 if board=="East Bridgewater"      & statefips==25
(1 real change made)

. replace county =  270 if board=="East Brookfield"       & statefips==25
(1 real change made)

. replace county =  170 if board=="Everett"                       & statefips==25
(1 real change made)

. replace county =   50 if board=="Fairhaven"                     & statefips==25
(1 real change made)

. replace county =   50 if board=="Fall River"            & statefips==25
(4 real changes made)

. replace county =  270 if board=="Fitchburg"                     & statefips==25
(1 real change made)

. replace county =  170 if board=="Framingham"            & statefips==25
(1 real change made)

. replace county =  270 if board=="Gardner"                       & statefips==25
(1 real change made)

. replace county =   90 if board=="Georgetown"            & statefips==25
(1 real change made)

. replace county =   90 if board=="Gloucester"            & statefips==25
(1 real change made)

. replace county =  110 if board=="Greenfield"            & statefips==25
(1 real change made)

. replace county =   90 if board=="Haverhill"                     & statefips==25
(2 real changes made)

. replace county =  130 if board=="Holyoke"                       & statefips==25
(2 real changes made)

. replace county =   90 if board=="Lawrence"                      & statefips==25
(3 real changes made)

. replace county =   30 if board=="Lee"                           & statefips==25
(1 real change made)

. replace county =  270 if board=="Leominster"            & statefips==25
(1 real change made)

. replace county =  170 if board=="Lowell"                        & statefips==25
(4 real changes made)

. replace county =  130 if board=="Ludlow"                        & statefips==25
(1 real change made)

. replace county =   90 if board=="Lynn"                          & statefips==25
(3 real changes made)

. replace county =  170 if board=="Malden"                        & statefips==25
(2 real changes made)

. replace county =  170 if board=="Marlborough"           & statefips==25
(1 real change made)

. replace county =  170 if board=="Medford"                       & statefips==25
(1 real change made)

. replace county =  170 if board=="Melrose"                       & statefips==25
(1 real change made)

. replace county =  270 if board=="Milford"                       & statefips==25
(1 real change made)

. replace county =  210 if board=="Needham"                       & statefips==25
(1 real change made)

. replace county =   50 if board=="New Bedford"           & statefips==25
(4 real changes made)

. replace county =   90 if board=="Newburyport"           & statefips==25
(1 real change made)

. replace county =   30 if board=="North Adams"           & statefips==25
(1 real change made)

. replace county =   50 if board=="North Easton"          & statefips==25
(1 real change made)

. replace county =  150 if board=="Northampton"           & statefips==25
(1 real change made)

. replace county =  210 if board=="Norwood"                       & statefips==25
(1 real change made)

. replace county =   90 if board=="Peabody"                       & statefips==25
(1 real change made)

. replace county =   30 if board=="Pittsfield"            & statefips==25
(1 real change made)

. replace county =  210 if board=="Quincy"                        & statefips==25
(1 real change made)

. replace county =  230 if board=="Rockland"                      & statefips==25
(1 real change made)

. replace county =   90 if board=="Salem"                         & statefips==25
(1 real change made)

. replace county =  170 if board=="Somerville"            & statefips==25
(3 real changes made)

. replace county =  210 if board=="South Braintree"       & statefips==25
(1 real change made)

. replace county =  270 if board=="Southbridge"           & statefips==25
(1 real change made)

. replace county =  130 if board=="Springfield"           & statefips==25
(3 real changes made)

. replace county =  170 if board=="Stoneham"                      & statefips==25
(1 real change made)

. replace county =   90 if board=="Swampscott"            & statefips==25
(1 real change made)

. replace county =   50 if board=="Taunton"                       & statefips==25
(1 real change made)

. replace county =  170 if board=="Tewksbury"                     & statefips==25
(1 real change made)

. replace county =  270 if board=="Uxbridge"                      & statefips==25
(1 real change made)

. replace county =  170 if board=="Waltham"                       & statefips==25
(1 real change made)

. replace county =  150 if board=="Ware"                          & statefips==25
(1 real change made)

. replace county =  170 if board=="West Newton"           & statefips==25
(1 real change made)

. replace county =  130 if board=="Westfield"                     & statefips==25
(1 real change made)

. replace county =  250 if board=="WlNTHROP"                      & statefips==25
(1 real change made)

. replace county =  170 if board=="Woburn"                        & statefips==25
(1 real change made)

. 
. * Michigan
. replace county =  250 if board=="Battle Creek"          & statefips==26
(1 real change made)

. replace county =  170 if board=="Bay City"                      & statefips==26
(2 real changes made)

. replace county = 1630 if board=="Detroit"                       & statefips==26
(26 real changes made)

. replace county =  490 if board=="Flint"                         & statefips==26
(2 real changes made)

. replace county =  810 if board=="Grand Rapids"          & statefips==26
(3 real changes made)

. replace county = 1630 if board=="Highland Park"         & statefips==26
(1 real change made)

. replace county =  650 if board=="Lansing"                       & statefips==26
(1 real change made)

. replace county =  470 if board=="Mackinaw"                      & statefips==26
(1 real change made)

. replace county = 1330 if board=="Oscesola"                      & statefips==26
(1 real change made)

. replace county = 1550 if board=="Shiawasee"                     & statefips==26
(1 real change made)

. 
. * Minnesota
. replace county = 1370 if board=="Duluth"                        & statefips==27
(4 real changes made)

. replace county =  610 if board=="Itaska"                        & statefips==27
(1 real change made)

. replace county =  690 if board=="Kittson"                       & statefips==27
(1 real change made)

. replace county =  530 if board=="Minneapolis"           & statefips==27
(13 real changes made)

. replace county = 1230 if board=="St Paul"                       & statefips==27
(11 real changes made)

. replace county = 1670 if board=="Wilkin"                        & statefips==27
(1 real change made)

. 
. * Mississippi
. replace county =  650 if board=="Davis"                         & statefips==28
(1 real change made)

. replace county = 1030 if board=="Noxubes"                       & statefips==28
(1 real change made)

. replace county = 1310 if board=="Stone"                         & statefips==28
(1 real change made)

. replace county = 1470 if board=="Walthall"                      & statefips==28
(1 real change made)

. 
. * Missouri
. replace county =  370 if board=="Cass"                          & statefips==29
(1 real change made)

. replace county =   50 if board=="Dale"                          & statefips==29
(1 real change made)

. replace county =  630 if board=="Dekalb"                        & statefips==29
(1 real change made)

. replace county =  830 if board=="Henry"                         & statefips==29
(1 real change made)

. replace county =  970 if board=="Joplin"                        & statefips==29
(1 real change made)

. replace county =  950 if board=="Kansas City"           & statefips==29
(16 real changes made)

. replace county =  770 if board=="Springfield"           & statefips==29
(1 real change made)

. replace county =  210 if board=="St Joseph"                     & statefips==29
(3 real changes made)

. 
. * Montana
. replace county =   30 if board=="Big Horn"                      & statefips==30
(1 real change made)

. replace county =   50 if board=="Blaine"                        & statefips==30
(1 real change made)

. replace county =  930 if board=="Butte"                         & statefips==30
(1 real change made)

. replace county =  110 if board=="Carter"                        & statefips==30
(1 real change made)

. replace county =  250 if board=="Fallon"                        & statefips==30
(1 real change made)

. replace county =  410 if board=="Hill"                          & statefips==30
(1 real change made)

. replace county =  610 if board=="Mineral"                       & statefips==30
(1 real change made)

. replace county =  650 if board=="Musselshell"           & statefips==30
(1 real change made)

. replace county =  710 if board=="Phillips"                      & statefips==30
(1 real change made)

. replace county =  790 if board=="Prairie"                       & statefips==30
(1 real change made)

. replace county =  830 if board=="Richland"                      & statefips==30
(1 real change made)

. replace county =  910 if board=="Sheridan"                      & statefips==30
(1 real change made)

. replace county =  950 if board=="Stillwater"            & statefips==30
(1 real change made)

. replace county =  1010 if board=="Toole"                        & statefips==30
(1 real change made)

. replace county =  1070 if board=="Wheatland"            & statefips==30
(1 real change made)

. replace county =  1090 if board=="Wibaux"                       & statefips==30
(1 real change made)

. 
. * Nebraska
. replace county =   50 if board=="Arthur"                        & statefips==31
(1 real change made)

. replace county =  970 if board=="Johnson"                       & statefips==31
(1 real change made)

. replace county = 1030 if board=="Keyapaha"                      & statefips==31
(1 real change made)

. replace county = 1070 if board=="Knox"                          & statefips==31
(1 real change made)

. replace county =  550 if board=="Omaha"                         & statefips==31
(5 real changes made)

. 
. * Nevada
. replace county =  210 if board=="Mineral"                       & statefips==32
(1 real change made)

. 
. * New Hampshire
. replace county =  110 if board=="Manchester"            & statefips==33
(3 real changes made)

. 
. * New Jersey
. replace county =   10 if board=="Atlantic City"         & statefips==34
(2 real changes made)

. replace county =  170 if board=="Bayonne"                       & statefips==34
(2 real changes made)

. replace county =  130 if board=="East Orange"           & statefips==34
(1 real change made)

. replace county =  390 if board=="Elizabeth"                     & statefips==34
(3 real changes made)

. replace county =  170 if board=="Hoboken"                       & statefips==34
(3 real changes made)

. replace county =  170 if board=="Jersey City"           & statefips==34
(10 real changes made)

. replace county =  130 if board=="Newark"                        & statefips==34
(13 real changes made)

. replace county =  130 if board=="NewarkNo 14"           & statefips==34
(1 real change made)

. replace county =  130 if board=="Orange"                        & statefips==34
(1 real change made)

. replace county =  310 if board=="Paterson"                      & statefips==34
(5 real changes made)

. replace county =  230 if board=="Perth Amboy"           & statefips==34
(1 real change made)

. replace county =  210 if board=="Trenton"                       & statefips==34
(4 real changes made)

. replace county =  170 if board=="West Hoboken"          & statefips==34
(1 real change made)

. 
. * New Mexico
. replace county =  110 if board=="De Baca"                       & statefips==35
(1 real change made)

. replace county =  250 if board=="Lea"                           & statefips==35
(1 real change made)

. 
. * New York
. replace county =  570 if board=="Amsterdam"                     & statefips==36
(1 real change made)

. replace county =  110 if board=="Auburn"                        & statefips==36
(1 real change made)

. replace county =   70 if board=="Binghamton"            & statefips==36
(2 real changes made)

. replace county =  290 if board=="Buffalo"                       & statefips==36
(16 real changes made)

. replace county =  150 if board=="Elmira"                        & statefips==36
(1 real change made)

. replace county =  130 if board=="Jamestown"                     & statefips==36
(1 real change made)

. replace county = 1190 if board=="Mount Vernon"          & statefips==36
(1 real change made)

. replace county = 1190 if board=="New Rochelle"          & statefips==36
(1 real change made)

. replace county =  630 if board=="Niagara Falls"         & statefips==36
(1 real change made)

. replace county =  670 if board=="Onondaga Nn 2"         & statefips==36
(1 real change made)

. replace county =  270 if board=="Poughkeepsie"          & statefips==36
(1 real change made)

. replace county =  550 if board=="Rochester"                     & statefips==36
(8 real changes made)

. replace county =  670 if board=="Syracuse"                      & statefips==36
(5 real changes made)

. replace county =  830 if board=="Troy"                          & statefips==36
(3 real changes made)

. replace county =  650 if board=="Utica"                         & statefips==36
(3 real changes made)

. replace county =  450 if board=="Watertown"                     & statefips==36
(1 real change made)

. replace county = 1190 if board=="Yonkers"                       & statefips==36
(3 real changes made)

. 
. * North Carolina
. replace county =  110 if board=="Avery"                         & statefips==37
(1 real change made)

. replace county = 1190 if board=="Charlotte"                     & statefips==37
(1 real change made)

. replace county =  930 if board=="Hoke"                          & statefips==37
(1 real change made)

. replace county = 1670 if board=="Stanley"                       & statefips==37
(1 real change made)

. replace county = 1290 if board=="Wilmington"            & statefips==37
(1 real change made)

. replace county =  670 if board=="Winston-Salem"         & statefips==37
(1 real change made)

. 
. * North Dakota
. replace county =  330 if board=="Golden Valley"         & statefips==38
(1 real change made)

. replace county =  450 if board=="Lamoure"                       & statefips==38
(1 real change made)

. replace county =  370 if board=="Plant"                         & statefips==38
(1 real change made)

. replace county =  850 if board=="Sioux"                         & statefips==38
(1 real change made)

. replace county =  870 if board=="Slope"                         & statefips==38
(1 real change made)

. 
. replace board  =  "Grant" if board=="Plant"             & statefips==38
(1 real change made)

. 
. * Ohio
. replace county = 1530 if board=="Akron"                         & statefips==39
(5 real changes made)

. replace county = 1510 if board=="Canton"                        & statefips==39
(2 real changes made)

. replace county =  610 if board=="Cincinnati"            & statefips==39
(10 real changes made)

. replace county =  350 if board=="Cleveland"                     & statefips==39
(18 real changes made)

. replace county =  490 if board=="Columbus"                      & statefips==39
(4 real changes made)

. replace county = 1130 if board=="Dayton"                        & statefips==39
(3 real changes made)

. replace county =  550 if board=="Geagua"                        & statefips==39
(1 real change made)

. replace county =   30 if board=="Lima"                          & statefips==39
(1 real change made)

. replace county =  890 if board=="Newark"                        & statefips==39
(1 real change made)

. replace county = 1250 if board=="Pauldin"                       & statefips==39
(1 real change made)

. replace county = 1430 if board=="Sabdusky"                      & statefips==39
(1 real change made)

. replace county =  230 if board=="Springfield"           & statefips==39
(1 real change made)

. replace county = 1530 if board=="Summitt"                       & statefips==39
(1 real change made)

. replace county =  950 if board=="Toledo"                        & statefips==39
(6 real changes made)

. replace county = 1630 if board=="Winton"                        & statefips==39
(1 real change made)

. replace county =  990 if board=="Youngstown"            & statefips==39
(3 real changes made)

. replace county = 1190 if board=="Zanesville"            & statefips==39
(1 real change made)

. 
. * Oklahoma
. replace county =  330 if board=="Cotton"                        & statefips==40
(1 real change made)

. replace county = 1090 if board=="Oklahoma City"         & statefips==40
(3 real changes made)

. 
. * Oregon
. replace county =  170 if board=="Deschutes"                     & statefips==41
(1 real change made)

. replace county =  310 if board=="Jefferson"                     & statefips==41
(1 real change made)

. replace county =  510 if board=="Portland"                      & statefips==41
(10 real changes made)

. 
. * Pennsylvania
. replace county =  770 if board=="Allentown"                     & statefips==42
(2 real changes made)

. replace county =  130 if board=="Altoona"                       & statefips==42
(2 real changes made)

. replace county =   70 if board=="Center"                        & statefips==42
(1 real change made)

. replace county =  950 if board=="Easton"                        & statefips==42
(1 real change made)

. replace county =  430 if board=="Harrisburg"            & statefips==42
(3 real changes made)

. replace county =  410 if board=="Kingstown"                     & statefips==42
(2 real changes made)

. replace county =   30 if board=="McKeesport"            & statefips==42
(2 real changes made)

. replace county =  730 if board=="New Castler"           & statefips==42
(1 real change made)

. replace county =  910 if board=="Norristown"            & statefips==42
(1 real change made)

. replace county =   30 if board=="Pittsburgh"            & statefips==42
(21 real changes made)

. replace county =  110 if board=="Reading"                       & statefips==42
(4 real changes made)

. replace county =  690 if board=="Scranton"                      & statefips==42
(5 real changes made)

. replace county =  790 if board=="Wilkes-Barre"          & statefips==42
(3 real changes made)

. replace county =  810 if board=="Williamsport"          & statefips==42
(1 real change made)

. 
. * Rhode Island
. replace county =   10 if board=="Barrington"            & statefips==44
(1 real change made)

. replace county =   70 if board=="Burrillville"          & statefips==44
(1 real change made)

. replace county =   70 if board=="Central Falls"         & statefips==44
(1 real change made)

. replace county =   70 if board=="Cranston"                      & statefips==44
(1 real change made)

. replace county =   70 if board=="Lonsdale"                      & statefips==44
(1 real change made)

. replace county =   30 if board=="Opponaug"                      & statefips==44
(1 real change made)

. replace county =   70 if board=="Pawtucket"                     & statefips==44
(2 real changes made)

. replace county =   90 if board=="Saunderstown"          & statefips==44
(1 real change made)

. replace county =   70 if board=="WOONSOCKET"            & statefips==44
(1 real change made)

. 
. * South Carolina
. replace county =  290 if board=="Celleton"                      & statefips==45
(1 real change made)

. replace county =  790 if board=="Columbia"                      & statefips==45
(1 real change made)

. replace county =  350 if board=="Dorcherster"           & statefips==45
(1 real change made)

. replace county =  530 if board=="Jasper"                        & statefips==45
(1 real change made)

. replace county =  670 if board=="Marian"                        & statefips==45
(1 real change made)

. replace county =  650 if board=="McCormick"                     & statefips==45
(1 real change made)

. 
. * South Dakota
. replace county =  290 if board=="Coddington"            & statefips==46
(1 real change made)

. replace county =  550 if board=="Haakon"                        & statefips==46
(1 real change made)

. replace county =  710 if board=="Jackson"                       & statefips==46
(1 real change made)

. replace county =  750 if board=="Jones"                         & statefips==46
(1 real change made)

. replace county = 1370 if board=="Ziebach"                       & statefips==46
(1 real change made)

. 
. * Tennessee
. replace county =  650 if board=="Chattanooga"           & statefips==47
(2 real changes made)

. replace county =  410 if board=="Dekalb"                        & statefips==47
(1 real change made)

. replace county =  930 if board=="Knoxville"                     & statefips==47
(2 real changes made)

. replace county = 1570 if board=="Memphis"                       & statefips==47
(5 real changes made)

. replace county =  370 if board=="Nashville"                     & statefips==47
(4 real changes made)

. 
. * Texas
. replace county = 1810 if board=="Bill"                          & statefips==48
(2 real changes made)

. replace county =  470 if board=="Brooks"                        & statefips==48
(1 real change made)

. replace county =  590 if board=="Callam"                        & statefips==48
(1 real change made)

. replace county =  670 if board=="Cass"                          & statefips==48
(1 real change made)

. replace county = 1090 if board=="Culberson"                     & statefips==48
(1 real change made)

. replace county = 1170 if board=="Dead Smith"            & statefips==48
(1 real change made)

. replace county = 4390 if board=="Fort Worth"            & statefips==48
(4 real changes made)

. replace county = 2290 if board=="Hudspeth"                      & statefips==48
(1 real change made)

. replace county = 2470 if board=="Jim Hogg"                      & statefips==48
(1 real change made)

. replace county = 2490 if board=="Jim Wells"                     & statefips==48
(1 real change made)

. replace county = 2730 if board=="Kleberg"                       & statefips==48
(1 real change made)

. replace county = 2810 if board=="Lampasa"                       & statefips==48
(1 real change made)

. replace county = 3790 if board=="Raines"                        & statefips==48
(1 real change made)

. replace county = 3850 if board=="Real"                          & statefips==48
(1 real change made)

. replace county =  290 if board=="San Antonio"           & statefips==48
(4 real changes made)

. replace county = 4170 if board=="Schackleford"          & statefips==48
(1 real change made)

. replace county = 4290 if board=="Stephens"                      & statefips==48
(1 real change made)

. replace county = 3090 if board=="Waco"                          & statefips==48
(1 real change made)

. replace county = 4890 if board=="Willacy"                       & statefips==48
(1 real change made)

. replace county = 5070 if board=="Zavalla"                       & statefips==48
(1 real change made)

. 
. replace board = "Bell" if board=="Bill" & statefips==48
(2 real changes made)

. 
. * Utah
. replace county =  110 if board=="Davls"                         & statefips==49
(1 real change made)

. replace county =  130 if board=="Duchesne"                      & statefips==49
(1 real change made)

. replace county =  570 if board=="Ogden"                         & statefips==49
(1 real change made)

. replace county =  350 if board=="Salt Lake City"        & statefips==49
(4 real changes made)

. replace county =  470 if board=="Uinta"                         & statefips==49
(1 real change made)

. 
. * Virginia
. replace county =   10 if board=="Accomac"                       & statefips==51
(1 real change made)

. replace county = 5100 if board=="Alexandria"            & statefips==51
(1 real change made)

. replace county = 1490 if board=="Prince Geogge"         & statefips==51
(1 real change made)

. 
. * Washington
. replace county =  730 if board=="Bellingham City"       & statefips==53
(1 real change made)

. replace county =  110 if board=="Clarke"                        & statefips==53
(1 real change made)

. replace county =  610 if board=="Everett"                       & statefips==53
(1 real change made)

. replace county =  270 if board=="Grays Harbor"          & statefips==53
(2 real changes made)

. replace county =  510 if board=="Pend Oreille"          & statefips==53
(1 real change made)

. replace county =  330 if board=="Seattle"                       & statefips==53
(12 real changes made)

. replace county =  530 if board=="Tacoma"                        & statefips==53
(4 real changes made)

. 
. * West Virginia
. replace county =  390 if board=="Charleston"            & statefips==54
(1 real change made)

. replace county =  110 if board=="Huntington"            & statefips==54
(2 real changes made)

. replace county =  690 if board=="Wheeling"                      & statefips==54
(1 real change made)

. 
. * Wisconsin
. replace county =   50 if board=="Barron"                        & statefips==55
(1 real change made)

. replace county =   70 if board=="Bayfield"                      & statefips==55
(1 real change made)

. replace county =   90 if board=="Green Bay"                     & statefips==55
(1 real change made)

. replace county =  250 if board=="Madison"                       & statefips==55
(1 real change made)

. replace county = 1390 if board=="Oshkosh"                       & statefips==55
(1 real change made)

. replace county =  310 if board=="Superior"                      & statefips==55
(2 real changes made)

. replace county = 1330 if board=="Vernon"                        & statefips==55
(1 real change made)

. 
. * Wyoming
. replace county =   50 if board=="Campbell"                      & statefips==56
(1 real change made)

. replace county =  150 if board=="Goshen"                        & statefips==56
(1 real change made)

. replace county =  170 if board=="Hot Springs"           & statefips==56
(1 real change made)

. replace county =  230 if board=="Lincoln"                       & statefips==56
(1 real change made)

. replace county =  270 if board=="Niobrara ;"            & statefips==56
(1 real change made)

. replace county =  310 if board=="Platte"                        & statefips==56
(1 real change made)

. replace county =  430 if board=="Washakie"                      & statefips==56
(1 real change made)

. 
. drop if county==.
(1 observation deleted)

. 
. drop board- tot_cancelled _merge error check_inducted

. 
. collapse (firstnm) statename name (sum)  tot_called_num tot_inducted_num tot_accepted_num tot_rejected_num tot_cancelled_num (mean) state, by(statefips county)

. order state

. 
. label var state "State ICPSR code"

. label var statefips "State FIPS code"

. label var county "County code"

. label var statename "State name"

. label var name "County name"

. label var tot_called_num "Total called"

. label var tot_inducted_num "Total inducted"

. label var tot_accepted_num "Total accepted"

. label var tot_rejected_num "Total rejected"

. label var tot_cancelled_num "Total rejected canellation of service"

. 
. compress
  variable state was float now byte
  variable tot_inducted_num was double now long
  variable tot_accepted_num was double now long
  variable tot_rejected_num was double now int
  variable tot_cancelled_num was double now int
  variable statename was str20 now str14
  variable name was str22 now str19
  (96,288 bytes saved)

. save "$path/Replication/cleaned_data/WWI inductions by county - clean.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/WWI inductions by county - clean.dta saved

. 
end of do-file

.         
.         * Generate the county level data
.         do "$path/Replication/1.C - Generate county level data.do"

. clear all

. capture set more off

. 
. /*
> * automatically set working directory
> foreach i in "Z:/Dropbox/projects/WWI German Discrimination"                            ///
>                          "D:/Dropbox/projects/WWI German Discrimination"                                ///
>                          "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"   ///
>                          "your directiory" {
> 
>                          global path "`i'"
>                          confirmdir "$path"
>                          if `r(confirmdir)'==0 continue, break
> }
> */
. 
. 
. * append Census data
. gen year = .

. 
. qui forval year = 1870(10)1940 {

. 
. * keep only counties (drop state aggregated)
. drop if level==2
(403 observations deleted)

. 
. * merge with WWI enlistments
. sort state county year

. 
. merge m:1 state county using "$path/Replication/cleaned_data/WWI inductions by county - clean.dta" 

    Result                      Number of obs
    -----------------------------------------
    Not matched                           594
        from master                       594  (_merge==1)
        from using                          0  (_merge==2)

    Matched                            22,316  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(0 observations deleted)

. drop _merge

. 
. * compute Germans in county
. egen germans = rowtotal(pbgerman pbwgerm)

. 
. gen germanshare = germans/totpop*100
(159 missing values generated)

. 
. 
. * merge with WWI casualties
. merge m:1 fips using "$path/Replication/cleaned_data/WWI casualties Army Navy clean - county.dta"
(variable fips was float, now double to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                         1,201
        from master                     1,196  (_merge==1)
        from using                          5  (_merge==2)

    Matched                            21,714  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(5 observations deleted)

. drop _merge

. 
. egen deaths_acc_dis = rowtotal(dead_acc dead_dis)

. 
. * age dist
. merge m:1 fips using "$path/Replication/raw_data/age_distribution.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                           710
        from master                       697  (_merge==1)
        from using                         13  (_merge==2)

    Matched                            22,213  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(13 observations deleted)

. drop _merge

. 
. egen age18_45_all = rowtotal(all_10- all_37)

. egen age18_45_amm = rowtotal(am_10- am_37)

. 
. egen age18_40_all = rowtotal(all_10- all_32)

. egen age18_40_amm = rowtotal(am_10- am_32)

. 
. egen age18_35_all = rowtotal(all_10- all_27)

. egen age18_35_amm = rowtotal(am_10- am_27)

. 
. drop all_10- am_37

. 
. * WWI camps
. merge m:1 fips using "$path/Replication/raw_data/WWI camp locations.dta" 

    Result                      Number of obs
    -----------------------------------------
    Not matched                           239
        from master                       239  (_merge==1)
        from using                          0  (_merge==2)

    Matched                            22,671  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(0 observations deleted)

. drop _merge

. 
. ren mindist mindist_camp

. 
. * war contracts
. merge m:1 fips using "$path/Replication/raw_data/warcontracts_geoloc.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                           239
        from master                       239  (_merge==1)
        from using                          0  (_merge==2)

    Matched                            22,671  (_merge==3)
    -----------------------------------------

. drop _merge

. 
. ren mindist mindist_contr

. 
. * Gentzkow-Shapiro data
. merge m:1 gisjoin using "$path/Replication/raw_data/neighborfile1910.dta", keepusing(gisjoin icpsrfip_1)

    Result                      Number of obs
    -----------------------------------------
    Not matched                         6,977
        from master                     6,972  (_merge==1)
        from using                          5  (_merge==2)

    Matched                            15,938  (_merge==3)
    -----------------------------------------

. gen newspaper_neighbor = _merge==3

. drop if _merge==2
(5 observations deleted)

. drop _merge

. 
. merge m:1 icpsrfip_1 using "$path/Replication/raw_data/Gentzkow_Shapiro_newspapers_cnty_clean.dta" 
(variable icpsrfip_1 was long, now double to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                         9,031
        from master                     8,413  (_merge==1)
        from using                        618  (_merge==2)

    Matched                            14,497  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(618 observations deleted)

. drop _merge

. 
. * merge with NPcom data
. merge m:1 fips using "$path/Replication/raw_data/npcom_data_2021-7-9.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                        16,926
        from master                    16,926  (_merge==1)
        from using                          0  (_merge==2)

    Matched                             5,984  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(0 observations deleted)

. drop _merge

. 
.  
. 
. egen casrate_1845all = max((dead_all/age18_45_all*100)*(year==1910)), by(fips)
(1,261 missing values generated)

. egen casrate_1845amm = max((dead_all/age18_45_amm*100)*(year==1910)), by(fips)
(1,261 missing values generated)

. egen casrate_1840all = max((dead_all/age18_40_all*100)*(year==1910)), by(fips)
(1,261 missing values generated)

. egen casrate_1840amm = max((dead_all/age18_40_amm*100)*(year==1910)), by(fips)
(1,261 missing values generated)

. egen casrate_1835all = max((dead_all/age18_35_all*100)*(year==1910)), by(fips)
(1,261 missing values generated)

. egen casrate_1835amm = max((dead_all/age18_35_amm*100)*(year==1910)), by(fips)
(1,261 missing values generated)

. 
. egen accrate_1845all = max((deaths_acc_dis/age18_45_all*100)*(year==1910)), by(fips)
(697 missing values generated)

. egen accrate_1845amm = max((deaths_acc_dis/age18_45_amm*100)*(year==1910)), by(fips)
(697 missing values generated)

. egen accrate_1840all = max((deaths_acc_dis/age18_40_all*100)*(year==1910)), by(fips)
(697 missing values generated)

. egen accrate_1840amm = max((deaths_acc_dis/age18_40_amm*100)*(year==1910)), by(fips)
(697 missing values generated)

. egen accrate_1835all = max((deaths_acc_dis/age18_35_all*100)*(year==1910)), by(fips)
(701 missing values generated)

. egen accrate_1835amm = max((deaths_acc_dis/age18_35_amm*100)*(year==1910)), by(fips)
(701 missing values generated)

. 
. 
. foreach v in casrate_1845all casrate_1845amm casrate_1840all casrate_1840amm casrate_1835all casrate_1835amm accrate_1845all accrate_1845amm accrate_1840all accrate_1840amm accrate_1835all accrate_1835amm {
  2.         
.         replace `v' = 100 if `v'>100 & `v'!=.
  3.         xtile c_`v'  = `v' if year==1910, nq(5)
  4.         egen Q5_`v' = max(c_`v'), by(fips)
  5.         replace Q5_`v' = 0 if year==1910
  6.         drop c_`v'
  7. }
(0 real changes made)
(1,261 missing values generated)
(2,960 real changes made)
(0 real changes made)
(1,261 missing values generated)
(2,960 real changes made)
(0 real changes made)
(1,261 missing values generated)
(2,960 real changes made)
(0 real changes made)
(1,261 missing values generated)
(2,960 real changes made)
(0 real changes made)
(1,261 missing values generated)
(2,960 real changes made)
(0 real changes made)
(1,261 missing values generated)
(2,960 real changes made)
(0 real changes made)
(699 missing values generated)
(2,960 real changes made)
(0 real changes made)
(699 missing values generated)
(2,960 real changes made)
(0 real changes made)
(699 missing values generated)
(2,960 real changes made)
(0 real changes made)
(699 missing values generated)
(2,960 real changes made)
(0 real changes made)
(703 missing values generated)
(2,960 real changes made)
(0 real changes made)
(703 missing values generated)
(2,960 real changes made)

. 
. xtile c2_casrate_1845amm = casrate_1845amm if year==1910, nq(2)

. xtile c3_casrate_1845amm = casrate_1845amm if year==1910, nq(3)

. xtile c4_casrate_1845amm = casrate_1845amm if year==1910, nq(4)

. 
. egen med_casrate_1845amm = max(c2_casrate_1845amm), by(fips)
(1,261 missing values generated)

. egen ter_casrate_1845amm = max(c3_casrate_1845amm), by(fips)
(1,261 missing values generated)

. egen quar_casrate_1845amm = max(c4_casrate_1845amm), by(fips)
(1,261 missing values generated)

. 
. drop c2_casrate_1845amm c3_casrate_1845amm c4_casrate_1845amm

.  
. gen casrate_temp = dead_all/mvote*100
(20,041 missing values generated)

. replace casrate_temp = 100 if casrate_temp>100 & casrate_temp!=.
(0 real changes made)

. 
. 
. egen casualtyrate   = max(casrate_temp), by(state county)
(1,218 missing values generated)

. 
. 
. 
. gen draftrate_amm1845_tmp = tot_accepted_num/age18_45_amm*100 if year==1910
(20,000 missing values generated)

. replace draftrate_amm1845_tmp   = 100 if draftrate_amm1845_tmp>100 & draftrate_amm1845_tmp!=.
(6 real changes made)

. 
. egen draftrate_amm1845 = max(draftrate_amm1845_tmp), by(state county)
(921 missing values generated)

. 
. gen draftrate_amm1845post       = draftrate_amm1845*(year>1910)
(921 missing values generated)

. 
. 
. 
. egen id = group(state county)

. 
. 
. xtset id year, delta(10)

Panel variable: id (unbalanced)
 Time variable: year, 1870 to 1940, but with gaps
         Delta: 10 units

. gen Dgermanshare = D.germanshare
(3,379 missing values generated)

. gen Dgermans = D.germans
(3,294 missing values generated)

. 
. gen negsh = Dgermanshare<0 if year==1920
(19,835 missing values generated)

. egen maxnegsh = max(negsh), by(id)
(274 missing values generated)

. 
. gen negnum = Dgermans<0 if year==1920
(19,835 missing values generated)

. egen maxnegnum = max(negnum), by(id)
(274 missing values generated)

. 
. * placebo groups
. egen swedes   = rowtotal(pbswedno pbsweden pbwswed)

. egen italians = rowtotal(pbitaly pbwitaly)

. egen english  = rowtotal(pbenglwa pbenglan pbwengla)

. 
. gen swedeshare   = swedes/totpop*100
(159 missing values generated)

. gen italianshare = italians/totpop*100
(159 missing values generated)

. gen englishshare = english/totpop*100
(159 missing values generated)

. 
. gen Dswedeshare   = D.swedeshare
(3,379 missing values generated)

. gen Ditalianshare = D.italianshare
(3,379 missing values generated)

. gen Denglishshare = D.englishshare
(3,379 missing values generated)

. 
. 
. *-------------------------------------------------------------------------------
. * determinants of draft and casualty rates
. *-------------------------------------------------------------------------------
. 
. * we drop one outlier which was also dropped by Roberts, Evan and Alexandra Burda, "Correlates and Consequences of American War Casualties in World War I," University of Minnesota Working Paper, 2018, 2018-3
. drop if casrate_1845amm>17 & casrate_1845amm!=.
(8 observations deleted)

. 
. * generate casualty rate quintiles
. gen casrate = casrate_1845amm
(1,261 missing values generated)

. 
. replace casualtyrate = . if casualtyrate>7
(2 real changes made, 2 to missing)

. xtile cas  = casualtyrate if year==1920, nq(5)

. egen quincas = max(cas), by(state county)
(1,220 missing values generated)

. replace quincas = 0 if year==1910
(2,959 real changes made)

. drop cas

. 
. 
. * residualize population growth and time fixed effects out from the different immigrant pop share growth rates
. 
.         * Germans
.         reg Dgermanshare totpop i.year

      Source |       SS           df       MS      Number of obs   =    19,524
-------------+----------------------------------   F(7, 19516)     =    116.77
       Model |  1295.97442         7  185.139203   Prob > F        =    0.0000
    Residual |  30943.6109    19,516  1.58555087   R-squared       =    0.0402
-------------+----------------------------------   Adj R-squared   =    0.0399
       Total |  32239.5853    19,523   1.6513643   Root MSE        =    1.2592

------------------------------------------------------------------------------
Dgermanshare | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
      totpop |  -7.45e-09   7.30e-09    -1.02   0.308    -2.18e-08    6.87e-09
             |
        year |
       1890  |   .5310936   .0363163    14.62   0.000     .4599106    .6022766
       1900  |   -.268542   .0357357    -7.51   0.000    -.3385871    -.198497
       1910  |  -.1364893   .0354916    -3.85   0.000     -.206056   -.0669227
       1920  |  -.3366001   .0351606    -9.57   0.000    -.4055179   -.2676824
       1930  |   .0306698   .0348557     0.88   0.379    -.0376504    .0989899
       1940  |   .0290715   .0347735     0.84   0.403    -.0390875    .0972305
             |
       _cons |  -.2845053   .0264365   -10.76   0.000    -.3363232   -.2326875
------------------------------------------------------------------------------

.         predict double Dgermanshareres, res 
(3,378 missing values generated)

. 
.         * do this for Swedes, Italians, and English as well (placebo groups)
.         qui reg Dswedeshare totpop i.year

.         predict double Dswedeshareres, res 
(3,378 missing values generated)

. 
.         qui reg Ditalianshare totpop i.year

.         predict double Ditalianshareres, res 
(3,378 missing values generated)

. 
.         qui reg Denglishshare totpop i.year

.         predict double Denglishshareres, res 
(3,378 missing values generated)

. 
. * pre war pop shares by group
.         egen ger1910 = max(germanshare*(year==1910)), by(id)
(70 missing values generated)

.         egen swe1910 = max(swedeshare*(year==1910)), by(id)
(70 missing values generated)

.         egen ita1910 = max(italianshare*(year==1910)), by(id)
(70 missing values generated)

. 
. 
. gen casrate2 = casrate
(1,261 missing values generated)

. replace casrate2 = 0 if year==1910
(2,959 real changes made)

. 
. *areg germanshare i.year#c.casrate2 i.year#c.casrate2#i1.maxnegnum i.year i.state#i.year c.totpop#i.year, a(id)
. *coefplot, keep(*cas*) vertical base omitted
. 
. 
. duplicates tag fips year, gen(tag)

Duplicates in terms of fips year

. drop if tag!=0
(107 observations deleted)

. drop tag

. 
. ren mfglabor mfglabor1

. 
. tabmiss mfgestab
    Variable |     Obs       Missings   Feq.Missings    NonMiss   Feq.NonMiss
-------------+---------------------------------------------------------------
    mfgestab |   22795        3896        17.09          18899        82.91

. 
. ren fips fipsRC

. merge 1:1 fipsRC year using "$path/Replication/raw_data/MiningManfUScounty1870to1970Fishbackrequest.dta", update
(variable mfgestab was long, now double to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                        12,976
        from master                     4,027  (_merge==1)
        from using                      8,949  (_merge==2)

    Matched                            18,768
        not updated                    16,550  (_merge==3)
        missing updated                 2,218  (_merge==4)
        nonmissing conflict                 0  (_merge==5)
    -----------------------------------------

. drop if _merge==2
(8,949 observations deleted)

. drop _merge

. 
. 
. 
. * merge with latitude and longitude information
. merge m:1 icpsrfip county using "$path/Replication/raw_data/county_lat_lon.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                           349
        from master                       321  (_merge==1)
        from using                         28  (_merge==2)

    Matched                            22,474  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(28 observations deleted)

. drop _merge

. 
. 
. * merge with newspaper data
. ren icpsrfip fips

. drop if fips==.
(134 observations deleted)

. 
. merge 1:1 fips year using "$path/Replication/raw_data/distance_to_nearest_county_w_newspaper_withNPCOM-2021-7-8.dta", update
(variable fips was float, now double to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                        19,723
        from master                    19,716  (_merge==1)
        from using                          7  (_merge==2)

    Matched                             2,945
        not updated                         0  (_merge==3)
        missing updated                     0  (_merge==4)
        nonmissing conflict             2,945  (_merge==5)
    -----------------------------------------

. drop if _merge==2
(7 observations deleted)

. 
. tabmiss mfgestab
    Variable |     Obs       Missings   Feq.Missings    NonMiss   Feq.NonMiss
-------------+---------------------------------------------------------------
    mfgestab |   22661        1653        7.294          21008        92.71

. 
. * firmsize
. gen firmsize = mfglabor/mfgestab
(5,695 missing values generated)

. 
. * deflate monetary values to baseline 1910
. foreach v in rmfgwagesth rmfgoutth mfgrms mfgout {
  2.         replace `v' = `v'*(28/38) if year==1870
  3.         replace `v' = `v'*(28/29) if year==1880
  4.         replace `v' = `v'*(28/27) if year==1890
  5.         replace `v' = `v'*(28/25) if year==1900
  6.         replace `v' = `v'*(28/60.2) if year==1920
  7.         replace `v' = `v'*(28/50.2) if year==1930
  8.         replace `v' = `v'*(28/42.1) if year==1940
  9. }
(1,762 real changes made)
(2,011 real changes made)
(2,146 real changes made)
(2,296 real changes made)
(2,291 real changes made)
(2,046 real changes made)
(1,845 real changes made)
(1,779 real changes made)
(2,021 real changes made)
(2,146 real changes made)
(2,300 real changes made)
(2,292 real changes made)
(2,046 real changes made)
(1,845 real changes made)
(2,068 real changes made)
(2,338 real changes made)
(2,488 real changes made)
(2,707 real changes made)
(2,860 real changes made)
(2,558 real changes made)
(2,344 real changes made)
(2,068 real changes made)
(2,338 real changes made)
(2,488 real changes made)
(2,707 real changes made)
(2,860 real changes made)
(2,558 real changes made)
(2,344 real changes made)

. 
. * source: https://www.minneapolisfed.org/community/financial-and-economic-education/cpi-calculator-information/consumer-price-index-1800
. 
. * log wages
. gen lnwages = ln(rmfgwagesth/mfglabor)
(6,046 missing values generated)

. 
. * worker productivity
. gen prod = rmfgoutth/mfglabor
(6,029 missing values generated)

. 
. * generated wages per material used
. gen wagepermat = mfgwages/mfgrms
(5,298 missing values generated)

. gen lnwagepermat = ln(wagepermat)
(5,332 missing values generated)

. 
. * output per material used
. gen outputpm = rmfgoutth/mfgrms
(8,232 missing values generated)

. gen lnoutputpm = ln(outputpm)
(8,232 missing values generated)

. 
. xtset id year, delta(10)

Panel variable: id (unbalanced)
 Time variable: year, 1870 to 1940, but with gaps
         Delta: 10 units

. 
. 
. 
. 
. gen post = year>1910

. 
. gen urbshare = urb25/totpop*100
(73 missing values generated)

. gen farmspc = farms/totpop*100
(211 missing values generated)

. 
. 
. * average pre-war emp in MFG
. egen meanL = mean(mfglabor/totpop) if year<=1910, by(id)
(11,345 missing values generated)

. egen prewarMFGL = max(meanL), by(id)
(4,187 missing values generated)

. replace prewarMFGL = 0 if year==1910
(2,893 real changes made)

. 
. egen meanpop = mean(totpop) if year<=1910, by(id)
(9,271 missing values generated)

. egen prewarPOP = max(meanpop), by(id)
(419 missing values generated)

. replace prewarPOP = 0 if year==1910
(2,947 real changes made)

. 
. egen meanMF = mean(mtot/ftot) if year<=1910, by(id)
(9,273 missing values generated)

. egen prewarMF = max(meanMF), by(id)
(424 missing values generated)

. replace prewarMF = 0 if year==1910
(2,948 real changes made)

. 
. 
. gen lnprod = ln(prod)
(6,029 missing values generated)

. gen lnfirmsize = ln(firmsize+1)
(5,695 missing values generated)

. 
. egen meanG = mean(germanshare) if year<=1910, by(id)
(9,273 missing values generated)

. egen prewarGer = max(meanG), by(id)
(424 missing values generated)

. replace prewarGer = 0 if year==1910
(2,919 real changes made)

. 
. * for placebo groups
.         egen meanS = mean(swedeshare) if year<=1910, by(id)
(9,273 missing values generated)

.         egen prewarSwe = max(meanS), by(id)
(424 missing values generated)

.         replace prewarSwe = 0 if year==1910
(2,574 real changes made)

.         
.         egen meanI = mean(italianshare) if year<=1910, by(id)
(9,273 missing values generated)

.         egen prewarIta = max(meanI), by(id)
(424 missing values generated)

.         replace prewarIta = 0 if year==1910
(2,216 real changes made)

.         
.         egen meanE = mean(englishshare) if year<=1910, by(id)
(9,273 missing values generated)

.         egen prewarEng = max(meanE), by(id)
(424 missing values generated)

.         replace prewarEng = 0 if year==1910
(2,925 real changes made)

.         
. 
. egen meanU = mean(urbshare) if year<=1910, by(id)
(9,273 missing values generated)

. egen prewarurb = max(meanU), by(id)
(424 missing values generated)

. replace prewarurb = 0 if year==1910
(201 real changes made)

. 
. gen outflow_temp = Dgermanshareres*(Dgermanshareres<0) if year==1920
(19,718 missing values generated)

. egen outflow = max(outflow_temp), by(id)
(460 missing values generated)

. replace outflow = 0 if year<1920
(4,367 real changes made)

. 
. 
. * now change scaling such that 1 unit incr in outflow means 1 p.p. incr in outflow
. replace outflow = abs(outflow)
(2,856 real changes made)

. 
. * do this for placebo groups too  
. 
.         * Swedish outflow from 1910-20
.         gen outflow_temp_swedes = Dswedeshareres*(Dswedeshareres<0) if year==1920
(19,718 missing values generated)

.         egen outflow_swedes = max(outflow_temp_swedes), by(id)
(460 missing values generated)

.         replace outflow_swedes = 0 if year<1920
(2,585 real changes made)

.         replace outflow_swedes = abs(outflow_swedes)
(1,779 real changes made)

. 
.         * Italian outflow from 1910-20
.         gen outflow_temp_italians = Ditalianshareres*(Ditalianshareres<0) if year==1920
(19,718 missing values generated)

.         egen outflow_italians = max(outflow_temp_italians), by(id)
(460 missing values generated)

.         replace outflow_italians = 0 if year<1920
(2,706 real changes made)

.         replace outflow_italians = abs(outflow_italians)
(1,800 real changes made)

. 
.         * English outflow from 1910-20
.         gen outflow_temp_english = Denglishshareres*(Denglishshareres<0) if year==1920
(19,718 missing values generated)

.         egen outflow_english = max(outflow_temp_english), by(id)
(460 missing values generated)

.         replace outflow_english = 0 if year<1920
(4,124 real changes made)

.         replace outflow_english = abs(outflow_english)
(2,775 real changes made)

.         
.         
. 
. * log Real value manufacturing output, thousands $ (NEED TO DEFLATE THIS!)
. gen lnrmfgoutth2 = ln(rmfgoutth)
(6,014 missing values generated)

. gen Pmiss = lnrmfgoutth2==.

. replace lnrmfgoutth2 = 0 if lnrmfgoutth2==.
(6,014 real changes made)

. ren lnrmfgoutth2 lnmfgout

. 
. /* log output
> gen lnmfgout = ln(1+mfgout)
> gen Pmiss = lnmfgout==.
> replace lnmfgout = 0 if lnmfgout==.
> */
. 
. replace mfgout = rmfgoutth if rmfgoutth!=. & mfgout==.
(2,218 real changes made)

. gen lnmfgoutB = ln(mfgout)
(3,080 missing values generated)

. 
. gen lnmat = ln(mfgrms+1)
(4,683 missing values generated)

. replace lnmat = 0 if lnmat==.
(4,683 real changes made)

. gen Mmiss = lnmat==.

. 
. gen Fmiss = firmsize==.

. replace firmsize = 0 if firmsize==.
(5,695 real changes made)

. 
. gen Emiss = mfgestab==.

. replace mfgestab = 0 if mfgestab==.
(1,653 real changes made)

. 
. gen year2 = year*year

. 
. gen lnmfgestab = ln(1+mfgestab)

. 
. gen lnwkr = ln(1+mfglabor)
(5,165 missing values generated)

. 
. gen lntotpop = ln(totpop)
(72 missing values generated)

. 
. gen south = statename=="Alabama"  | statename=="Delaware"        | statename=="Florida"                 | statename=="Georgia"            | statename=="Louisiana"      | ///
>                         statename=="Maryland" | statename=="Mississippi" | statename=="North Carolina"  | statename=="South Carolina" | statename=="Texas"              | ///
>                         statename=="Virginia"

. 
. gen southpost = south*post

. 
. gen prewarGersouthpost = southpost*prewarGer
(423 missing values generated)

. 
. * drop some outliers (where the share of Germans goes from a hand full to 1000+ in one decade)
. drop if Dgermanshare>5 & year==1890 & Dgermanshare!=.
(24 observations deleted)

.         
. 
. compress
  variable year was float now int
  variable state was int now byte
  variable county was float now int
  variable chitot was long now int
  variable indtot was long now int
  variable pbar was long now int
  variable pbfl was long now int
  variable pbia was long now int
  variable pbks was long now int
  variable pbmn was long now int
  variable pbne was long now int
  variable pbor was long now int
  variable pbtx was long now int
  variable pbvt was long now int
  variable pbit was int now byte
  variable pbnm was long now int
  variable pbut was long now int
  variable pbns was int now byte
  variable pbafrica was int now byte
  variable pbbritam was long now int
  variable pbchina was long now int
  variable pbdenmar was long now int
  variable pbenglwa was long now int
  variable pbfrance was long now int
  variable pbhollan was long now int
  variable pbhung was int now byte
  variable pbmexico was long now int
  variable pbpoland was long now int
  variable pbportug was long now int
  variable pbscot was long now int
  variable pbswedno was long now int
  variable pbswitz was long now int
  variable fbsch was long now int
  variable comsch was long now int
  variable cofsch was long now int
  variable wm10writ was long now int
  variable wf10writ was long now int
  variable wm15writ was long now int
  variable wf15writ was long now int
  variable wm21writ was long now int
  variable com10wri was long now int
  variable cof10wri was long now int
  variable com15wri was long now int
  variable cof15wri was long now int
  variable com21wri was long now int
  variable cof21wri was long now int
  variable farms was long now int
  variable farm02 was long now int
  variable farm39 was long now int
  variable farm1019 was long now int
  variable farm2049 was long now int
  variable farm5099 was long now int
  variable farm100 was long now int
  variable farm500 was long now int
  variable farm1000 was long now int
  variable mfglbch was long now int
  variable baptist was int now byte
  variable christia was int now byte
  variable chrissit was long now int
  variable congrega was int now byte
  variable episcopa was int now byte
  variable evangsit was long now int
  variable quaker was int now byte
  variable quaksit was long now int
  variable jewish was int now byte
  variable jewisit was long now int
  variable lutheran was int now byte
  variable morman was int now byte
  variable mormosit was long now int
  variable refldutc was int now byte
  variable refdusit was long now int
  variable reflgerm was int now byte
  variable refgesit was long now int
  variable rcatholi was int now byte
  variable secadven was int now byte
  variable secadsit was long now int
  variable unitaria was int now byte
  variable unitasit was long now int
  variable unibreth was int now byte
  variable unibrsit was long now int
  variable universa was int now byte
  variable univesit was long now int
  variable churches was long now int
  variable edifices was long now int
  variable irsestab was int now byte
  variable irslabor was long now int
  variable irslbm16 was long now int
  variable farmown was long now int
  variable fa02ow was int now byte
  variable fa39ow was long now int
  variable fa1019ow was long now int
  variable fa2049ow was long now int
  variable fa5099ow was long now int
  variable fa100ow was long now int
  variable fa500ow was long now int
  variable farmten was long now int
  variable fa02te was int now byte
  variable fa1019te was long now int
  variable fa2049te was long now int
  variable fa5099te was long now int
  variable fa100te was long now int
  variable fa500te was int now byte
  variable fa1000te was int now byte
  variable farmsc was long now int
  variable fa02sc was int now byte
  variable fa1019sc was long now int
  variable fa2049sc was long now int
  variable fa5099sc was long now int
  variable fa100sc was long now int
  variable fa500sc was int now byte
  variable fa1000sc was int now byte
  variable farms2 was long now int
  variable pbwv was long now int
  variable chi1880 was long now int
  variable chi1870 was long now int
  variable jap1880 was int now byte
  variable ind1880 was long now int
  variable colm520 was long now int
  variable colf520 was long now int
  variable colm1844 was long now int
  variable colm21 was long now int
  variable farm09 was long now int
  variable fa09ow was long now int
  variable mfgfoff was long now int
  variable cswmtea was long now int
  variable cswftea was long now int
  variable cscomtea was int now byte
  variable cscompup was long now int
  variable cscofpup was long now int
  variable pbhungar was long now int
  variable pbindia was int now byte
  variable pbjapan was long now int
  variable pbnorway was long now int
  variable pbwales was long now int
  variable farmfams was long now int
  variable farmfree was long now int
  variable farmencu was long now int
  variable farmrent was long now int
  variable faown80 was long now int
  variable farent80 was long now int
  variable homeencu was long now int
  variable nwmillit was long now int
  variable nnegmlit was long now int
  variable nnegmill was long now int
  variable ncolmill was long now int
  variable fbmnaill was long now int
  variable fbmfplit was long now int
  variable fbmfpill was long now int
  variable fbmalill was long now int
  variable fbmunill was long now int
  variable negm520 was long now int
  variable negf520 was long now int
  variable ocom520 was long now int
  variable ocof520 was long now int
  variable negm1844 was long now int
  variable ocom1844 was long now int
  variable nwnpil10 was long now int
  variable nwfpil10 was long now int
  variable colill10 was long now int
  variable negill10 was long now int
  variable pbfinlan was long now int
  variable pbpolaus was long now int
  variable pbpolrus was long now int
  variable mfgprops was long now int
  variable farm12 was long now int
  variable farm175 was long now int
  variable farm260 was long now int
  variable farmwh was long now int
  variable farmwhow was long now int
  variable farmwhpo was long now int
  variable farmwhte was long now int
  variable farmwhma was long now int
  variable farmwhct was long now int
  variable farmwhst was long now int
  variable farmcol was long now int
  variable farmcoow was long now int
  variable farmcote was int now byte
  variable farmcoma was int now byte
  variable farmcoct was long now int
  variable farmcost was long now int
  variable farmsbui was long now int
  variable tfarmhom was long now int
  variable fhowfree was long now int
  variable fhencumb was long now int
  variable fhmtgunk was long now int
  variable fhrent was long now int
  variable fhunk was long now int
  variable ohmtgunk was long now int
  variable ohunk was long now int
  variable negmvote was long now int
  variable othmvote was long now int
  variable nwmilvot was long now int
  variable negmilvo was long now int
  variable nwill10 was long now int
  variable till1020 was long now int
  variable neg614 was long now int
  variable negs614 was long now int
  variable pbwatlis was long now int
  variable pbwbelg was long now int
  variable pbwcanfr was long now int
  variable pbwdenmk was long now int
  variable pbwfinl was long now int
  variable pbwfran was long now int
  variable pbwgreec was long now int
  variable pbwholl was long now int
  variable pbwnorw was long now int
  variable pbwportu was long now int
  variable pbwruman was long now int
  variable pbwscot was long now int
  variable pbwspain was long now int
  variable pbwswitz was long now int
  variable pbwturk was long now int
  variable pbwturka was long now int
  variable pbwwales was long now int
  variable pbwotfor was long now int
  variable nwfpcafr was long now int
  variable nwfpcaot was long now int
  variable nwfpdenm was long now int
  variable nwfpengl was long now int
  variable nwfpfran was long now int
  variable nwfpgrec was int now byte
  variable nwfpholl was long now int
  variable nwfphung was long now int
  variable nwfpnorw was long now int
  variable nwfpscot was long now int
  variable nwfpswit was long now int
  variable nwfpwale was long now int
  variable farmnw was long now int
  variable farmfbw was long now int
  variable farmneg was long now int
  variable farmown1 was long now int
  variable farmown2 was long now int
  variable fownnw was long now int
  variable fownfbw was long now int
  variable fownneg was long now int
  variable farmsten was long now int
  variable farmsct was long now int
  variable farmcten was long now int
  variable farmoten was long now int
  variable farmnwte was long now int
  variable farmfbwt was long now int
  variable farmnegt was long now int
  variable farmman was long now int
  variable fbunwm21 was long now int
  variable fbfpwf21 was long now int
  variable fbunwf21 was long now int
  variable till1620 was long now int
  variable nwmil21 was long now int
  variable negmil21 was long now int
  variable nwfil21 was long now int
  variable negfil21 was long now int
  variable pbwarmen was long now int
  variable pbwsyria was long now int
  variable pbwyugos was long now int
  variable farmmale was long now int
  variable farmfem was long now int
  variable fowncol was long now int
  variable farmscro was long now int
  variable farmsren was long now int
  variable farmcolt was long now int
  variable ownunk was long now int
  variable tenunk was long now int
  variable m15divor was long now int
  variable m15unkms was long now int
  variable f15unkms was long now int
  variable urbfarm was long now int
  variable pbwazore was long now int
  variable pbwcsoam was long now int
  variable pbwulst was long now int
  variable pbwpales was long now int
  variable pbwturky was long now int
  variable funemp was long now int
  variable tolayoff was long now int
  variable mlayoff was long now int
  variable flayoff was long now int
  variable wholest was long now int
  variable farmfown was long now int
  variable farmpown was long now int
  variable farmsrep was long now int
  variable unempnem was long now int
  variable unempnef was long now int
  variable emergwf was long now int
  variable emergnem was long now int
  variable emergnef was long now int
  variable punempwf was long now int
  variable punempnm was long now int
  variable punempnf was long now int
  variable unfartot was long now int
  variable ununktot was long now int
  variable emfartot was long now int
  variable emunktot was long now int
  variable pufartot was long now int
  variable puunktot was long now int
  variable fbunm21 was long now int
  variable fbunf21 was long now int
  variable tsch2124 was long now int
  variable m25edunk was long now int
  variable f25edunk was long now int
  variable pbwoasia was long now int
  variable f14self was long now int
  variable m14ufw was long now int
  variable f14ufw was long now int
  variable m14unkw was long now int
  variable f14unkw was long now int
  variable f14emerg was long now int
  variable m14new was long now int
  variable f14new was long now int
  variable msprof was long now int
  variable fsprof was long now int
  variable mfarm was long now int
  variable ffarm was long now int
  variable fmanag was long now int
  variable fcraft was long now int
  variable mdomest was long now int
  variable mflabwag was long now int
  variable fflabwag was long now int
  variable mflabufw was long now int
  variable fflabufw was long now int
  variable flabor was long now int
  variable moccunk was long now int
  variable foccunk was long now int
  variable wholprop was long now int
  variable servest was long now int
  variable servprop was long now int
  variable dwoccoth was long now int
  variable dwownneg was long now int
  variable dwownoth was long now int
  variable dwrenoth was long now int
  variable farmnonw was long now int
  variable farmscte was long now int
  variable frebuild was long now int
  variable frebufow was long now int
  variable frebupow was long now int
  variable frebuman was long now int
  variable frebuten was long now int
  variable frebucte was long now int
  variable frebusct was long now int
  variable frebuste was long now int
  variable frebuote was long now int
  variable freeqval was long now int
  variable freeqfow was long now int
  variable freeqpow was long now int
  variable freeqten was long now int
  variable freeqcte was long now int
  variable freeqsct was long now int
  variable freeqste was long now int
  variable freeqote was long now int
  variable farm02s was int now byte
  variable farm1029 was long now int
  variable farm3049 was long now int
  variable farm5069 was long now int
  variable farm7099 was long now int
  variable farm140 was long now int
  variable farm180 was long now int
  variable farm220 was long now int
  variable farm380 was long now int
  variable farm700 was long now int
  variable deaths_acc_dis was float now int
  variable newspaper_neighbor was float now byte
  variable dem_papers was int now byte
  variable Q5_casrate_1845all was float now byte
  variable Q5_casrate_1845amm was float now byte
  variable Q5_casrate_1840all was float now byte
  variable Q5_casrate_1840amm was float now byte
  variable Q5_casrate_1835all was float now byte
  variable Q5_casrate_1835amm was float now byte
  variable Q5_accrate_1845all was float now byte
  variable Q5_accrate_1845amm was float now byte
  variable Q5_accrate_1840all was float now byte
  variable Q5_accrate_1840amm was float now byte
  variable Q5_accrate_1835all was float now byte
  variable Q5_accrate_1835amm was float now byte
  variable med_casrate_1845amm was float now byte
  variable ter_casrate_1845amm was float now byte
  variable quar_casrate_1845amm was float now byte
  variable id was float now int
  variable negsh was float now byte
  variable maxnegsh was float now byte
  variable negnum was float now byte
  variable maxnegnum was float now byte
  variable quincas was float now byte
  variable post was float now byte
  variable Pmiss was float now byte
  variable Mmiss was float now byte
  variable Fmiss was float now byte
  variable Emiss was float now byte
  variable south was float now byte
  variable southpost was float now byte
  variable farmval was double now long
  variable equipval was double now long
  variable farmout was double now long
  variable livstock was double now long
  variable mfgestab was double now int
  variable mfgcap was double now long
  variable mfgwages was double now long
  variable wealthas was double now long
  variable realest was double now long
  variable persest was double now long
  variable mfgcapeq was double now long
  variable mfgcapca was double now long
  variable valtot was double now long
  variable valfaenc was double now long
  variable valhoenc was double now long
  variable mfgprms was double now long
  variable farmbui was double now long
  variable farmequi was double now long
  variable cropval was double now long
  variable cerealva was double now long
  variable hayval was double now long
  variable otcropva was double now long
  variable favalown was double now long
  variable favalten was double now long
  variable favalman was double now long
  variable mfgrentx was double now long
  variable mfgvalad was double now long
  variable landval was double now long
  variable wholwage was double now long
  variable wholstoc was double now long
  variable fdwellva was double now long
  variable favalwh was double now long
  variable favafown was double now long
  variable favapown was double now long
  variable favacten was double now long
  variable favaoten was double now long
  variable croval29 was double now long
  variable cerval29 was double now long
  variable favapow1 was double now long
  variable favapow2 was double now long
  variable favascte was double now long
  variable favasten was double now long
  variable buildval was double now long
  variable buvafown was double now long
  variable buvalten was double now long
  variable icpsrfip_1 was double now long
  variable mfglabor was double now long
  variable name was str31 now str22
  (21,889,979 bytes saved)

. save "$path/Replication/cleaned_data/county_panel_longrun.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/county_panel_longrun.dta saved

. 
. 
. 
. 
. * globals w controls for OLS and IV
. global controls "c.prewarGer i.year draftrate_amm1845post c.prewarPOP#1.post c.prewarMFGL#1.post c.prewarMF#1.post c.prewarurb#1.post"

. 
. * w time varying pop control
. global controls2 "c.prewarGer i.year draftrate_amm1845post c.prewarPOP#1.post c.prewarMFGL#1.post c.prewarMF#1.post totpop mtot c.prewarurb#1.post"

. 
. 
. * generate sample
. qui reghdfe lnwages outflow $controls if year>1890 , a(id) cluster(id)

. gen S1 = e(sample)==1

. 
. qui ivreghdfe lnmfgestab (outflow= 5.Q5_casrate_1845amm#1.post) $controls2 if year>1890 , a(id) cluster(id)

. gen S2 = e(sample)==1

. 
. gen S = S1==1 & S2==1

. keep if S==1
(12,284 observations deleted)

. drop S1 S2

. 
. gen quincas5 = quincas==5

. replace prewarMFGL = prewarMFGL*100
(8,158 real changes made)

. gen casrate5 = casrate_1845amm if Q5_casrate_1845amm==5
(8,922 missing values generated)

. 
. gen lnmfgoutpc = ln(1+mfgout/totpop)

. gen lnmfgoutperfirm = ln(mfgout)/mfgestab

. 
. 
. 
. 
. 
. gen enemy_share_npcom20 = enemy_share_npcom if year==1920
(8,686 missing values generated)

. gen hun_share_npcom20 = hun_share_npcom if year==1920
(8,686 missing values generated)

. gen tar_share_npcom20 = tar_share_npcom if year==1920
(8,686 missing values generated)

. 
. 
. label var germanshare                   "Share of German-born individuals"

. label var casrate_1845amm               "WWI Casualty Rate"

. label var Q5_casrate_1845amm    "Dummy Top Casualty Quintile"

. label var casrate5                      "Casualty Rate in the Top Quintile"

. label var draftrate_amm1845             "WWI Draft Rate"

. label var prewarGer                     "Pre-WWI German Share"

. label var prewarPOP                     "Pre-WWI Population"

. label var prewarurb                     "Pre-WWI Urbanization Rate"

. label var prewarMF                      "Pre-WWI Male-to-Female Ratio"

. label var prewarMFGL                    "Pre-WWI Share of Manufacturing Empl."

. label var lnwages                               "Log Per Capita Wages in Manufacturing"

. label var outflow                               "\% Outflow of German Population, 1910-20"

. label var enemy_share_npcom20   "\% pages calling Germans \textit{enemies}"

. label var hun_share_npcom20             "\% pages calling Germans \textit{huns}"

. label var tar_share_npcom20             "\% pages mentioning taring and feathering"

. 
. 
. gen wages = rmfgwagesth*1000/mfglabor

. 
. 
. 
. 
. egen max_outflow = max(outflow), by(id)

. replace max_outflow = 0 if year==1910
(754 real changes made)

. 
. foreach v in prewarPOP prewarMFGL prewarMF prewarurb {
  2.         gen `v'post = `v'*(post==1)
  3. }

. gen quin5post = (Q5_casrate_1845amm==5)*(post==1)

. 
. 
. gen mfglaborpc = mfglabor/totpop

. gen lnmfglaborpc = ln(mfglaborpc)

. gen mfgestabpc = mfgestab/totpop

. 
. cap drop weight

. 
. gen weight = 1/mindist
(8,157 missing values generated)

. 
. 
. gen treat = 5.Q5_casrate_1845amm#1.post

. 
. gen IV = 5.Q5_casrate_1845amm#1.post

. 
. * save outflow data at the county level as separate data file for the individual census data
. preserve

.         
.         keep if year==1920
(8,157 observations deleted)

.         keep fips outflow

.         
.         compress
  variable fips was double now long
  (8,784 bytes saved)

.         save "$path/Replication/cleaned_data/outflow_from_cnty_cens.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/outflow_from_cnty_cens.dta saved

. restore

. 
. compress
  variable urb870 was long now byte
  variable cotot was long now byte
  variable chitot was int now byte
  variable indtot was int now byte
  variable nbtot was long now byte
  variable fbtot was long now byte
  variable fptot was long now byte
  variable fpfath was long now byte
  variable fpmoth was long now byte
  variable fpboth was long now byte
  variable nbtot2 was long now byte
  variable nbsttot was long now byte
  variable pbal was long now byte
  variable pbar was int now byte
  variable pbca was long now byte
  variable pbct was long now byte
  variable pbde was long now byte
  variable pbfl was int now byte
  variable pbga was long now byte
  variable pbil was long now byte
  variable pbin was long now byte
  variable pbia was int now byte
  variable pbks was int now byte
  variable pbky was long now byte
  variable pbla was long now byte
  variable pbme was long now byte
  variable pbmd was long now byte
  variable pbma was long now byte
  variable pbmi was long now byte
  variable pbmn was int now byte
  variable pbms was long now byte
  variable pbmo was long now byte
  variable pbne was int now byte
  variable pbnv was int now byte
  variable pbnh was long now byte
  variable pbnj was long now byte
  variable pbny was long now byte
  variable pbnc was long now byte
  variable pboh was long now byte
  variable pbor was int now byte
  variable pbpa was long now byte
  variable pbri was long now byte
  variable pbsc was long now byte
  variable pbtn was long now byte
  variable pbtx was int now byte
  variable pbvt was int now byte
  variable pbvawv was long now byte
  variable pbwi was long now byte
  variable pbaz was int now byte
  variable pbco was int now byte
  variable pbsd was int now byte
  variable pbdc was long now byte
  variable pbid was int now byte
  variable pbmt was int now byte
  variable pbnm was int now byte
  variable pbut was int now byte
  variable pbwa was int now byte
  variable pbwy was int now byte
  variable fbtot2 was long now byte
  variable pbaustra was int now byte
  variable pbaustri was long now int
  variable pbbohem was long now int
  variable pbbritam was int now byte
  variable pbenglwa was int now byte
  variable pbgerman was long now int
  variable pbgrbrit was int now byte
  variable pbirelan was long now int
  variable pbitaly was long now int
  variable pbrussia was long now int
  variable pbswedno was int now byte
  variable totsch was long now byte
  variable nbsch was long now byte
  variable fbsch was int now byte
  variable wmsch was long now byte
  variable wfsch was long now byte
  variable comsch was int now byte
  variable cofsch was int now byte
  variable indsch was int now byte
  variable chisch was int now byte
  variable noread was long now byte
  variable nowrite was long now byte
  variable nbnowrit was long now byte
  variable fbnowrit was long now byte
  variable wm10writ was int now byte
  variable wf10writ was int now byte
  variable wm15writ was int now byte
  variable wf15writ was int now byte
  variable wm21writ was int now byte
  variable wf21writ was long now byte
  variable com10wri was int now byte
  variable cof10wri was int now byte
  variable com15wri was int now byte
  variable cof15wri was int now byte
  variable com21wri was int now byte
  variable cof21wri was int now byte
  variable indwri was int now byte
  variable chiwri was int now byte
  variable m518 was long now byte
  variable f518 was long now byte
  variable m21tot was long now byte
  variable mcit21 was long now byte
  variable orchard was long now byte
  variable homemfg was long now byte
  variable slaugval was long now byte
  variable mfglabor1 was long now byte
  variable mfglbm16 was long now int
  variable mfglbf16 was long now int
  variable wealthas was long now byte
  variable taxnonat was long now byte
  variable taxstate was long now byte
  variable taxcoun was long now byte
  variable taxlocal was long now byte
  variable debtcoun was long now byte
  variable debtlocl was long now byte
  variable baptsit was long now byte
  variable chrissit was int now byte
  variable congrsit was long now byte
  variable episcsit was long now byte
  variable evangeli was int now byte
  variable evangsit was int now byte
  variable quaksit was int now byte
  variable jewisit was int now byte
  variable luthesit was long now byte
  variable methodis was int now byte
  variable methosit was long now byte
  variable mormosit was int now byte
  variable newjesit was int now byte
  variable presbyte was int now byte
  variable presbsit was long now byte
  variable refdusit was int now byte
  variable refgesit was int now byte
  variable rcathsit was long now byte
  variable secadsit was int now byte
  variable unitasit was int now byte
  variable unibrsit was int now byte
  variable univesit was int now byte
  variable churches was int now byte
  variable edifices was int now byte
  variable sittings was long now byte
  variable churval was long now byte
  variable urb880 was long now byte
  variable m517 was long now byte
  variable f517 was long now byte
  variable mfglbf15 was long now byte
  variable irscap was long now byte
  variable irslabor was int now byte
  variable irslbm16 was int now byte
  variable irslbmch was int now byte
  variable irswagsk was float now byte
  variable irswagun was float now byte
  variable irswages was long now byte
  variable irsrms was long now byte
  variable irsout was long now byte
  variable irstons was long now byte
  variable fa39ow was int now byte
  variable fa1019ow was int now byte
  variable fa2049ow was int now byte
  variable fa5099ow was int now byte
  variable fa100ow was int now byte
  variable fa500ow was int now byte
  variable fa1000ow was int now byte
  variable fa39te was int now byte
  variable fa1019te was int now byte
  variable fa2049te was int now byte
  variable fa5099te was int now byte
  variable fa100te was int now byte
  variable farmsc was int now byte
  variable fa39sc was int now byte
  variable fa1019sc was int now byte
  variable fa2049sc was int now byte
  variable fa5099sc was int now byte
  variable fa100sc was int now byte
  variable acimptil was long now byte
  variable acmeadow was long now byte
  variable acunimp was long now byte
  variable farfence was long now byte
  variable farmfert was long now byte
  variable shipnew was int now byte
  variable shipnton was long now byte
  variable shipnval was long now byte
  variable shiprval was long now byte
  variable shipout was long now byte
  variable barley was long now byte
  variable buckwhea was long now byte
  variable corn was long now byte
  variable oats was long now byte
  variable rye was long now byte
  variable wheat was long now byte
  variable realest was long now byte
  variable persest was long now byte
  variable area was long now int
  variable pbcentam was int now byte
  variable pbva was long now byte
  variable pbwv was int now byte
  variable pbsea was int now byte
  variable urb890 was long now byte
  variable neg1880 was long now byte
  variable neg1870 was long now byte
  variable chi1880 was int now byte
  variable chi1870 was int now byte
  variable japtot was int now byte
  variable ind1880 was int now byte
  variable ind1870 was int now byte
  variable nbwmfp was long now int
  variable nbwffp was long now int
  variable colmtot was long now int
  variable colftot was long now int
  variable nbwm520 was long now int
  variable nbwf520 was long now int
  variable fbwm520 was long now int
  variable fbwf520 was long now int
  variable colm520 was int now byte
  variable colf520 was int now byte
  variable nbwm1844 was long now int
  variable fbwm1844 was long now int
  variable colm1844 was int now byte
  variable nbwm21 was long now byte
  variable colm21 was int now byte
  variable fa09ow was int now byte
  variable fa09te was int now byte
  variable fa09sc was int now byte
  variable barleyac was long now byte
  variable buckwhac was long now byte
  variable cornac was long now byte
  variable oatsac was long now byte
  variable ryeac was long now byte
  variable wheatac was long now byte
  variable mfgavemp was long now byte
  variable mfgmoff was long now byte
  variable mfgmofwa was long now byte
  variable mfgfoff was int now byte
  variable mfgfofwa was long now byte
  variable mfgwgf15 was long now byte
  variable mfgpwm16 was long now byte
  variable pwwagm16 was long now byte
  variable mfgpwf15 was long now byte
  variable pwwagf15 was long now byte
  variable mfgpwch was int now byte
  variable pwwagch was long now byte
  variable cswmtea was int now byte
  variable cswftea was int now byte
  variable cscoftea was int now byte
  variable cswmpup was long now byte
  variable cswfpup was long now byte
  variable cscompup was int now byte
  variable cscofpup was int now byte
  variable pbasia was int now byte
  variable pbcanada was long now byte
  variable pbcubawi was int now byte
  variable pbenglan was long now int
  variable pbeurns was int now byte
  variable pbpacifi was int now byte
  variable pbhawaii was int now byte
  variable pbsoamer was int now byte
  variable pbsweden was long now int
  variable farmfams was int now byte
  variable farmfree was int now byte
  variable farmencu was int now byte
  variable farmrent was int now byte
  variable faown80 was int now byte
  variable farent80 was int now byte
  variable homefams was long now byte
  variable homeown was long now byte
  variable homefree was long now byte
  variable homeencu was int now byte
  variable homerent was long now byte
  variable valtot was long now byte
  variable valmtg was long now byte
  variable valfaenc was long now byte
  variable valfamtg was long now byte
  variable valhoenc was long now byte
  variable valhomtg was long now byte
  variable inttot was long now byte
  variable intfarm was long now byte
  variable inthome was long now byte
  variable nwmlit was long now int
  variable fbmnalit was long now int
  variable fbmallit was long now int
  variable fbmunlit was long now int
  variable fbwill10 was long now int
  variable privfam was long now int
  variable pbcaneng was long now int
  variable pbcanfr was long now int
  variable pbpolger was long now int
  variable pbpoloth was int now byte
  variable pbrumani was int now byte
  variable mfgoffic was long now int
  variable privfam2 was long now int
  variable tothhome was long now int
  variable ohowfree was long now int
  variable ohencumb was long now int
  variable ohrent was long now int
  variable nwnpmvot was long now int
  variable nwfpmvot was long now int
  variable nwmpmvot was long now int
  variable fbnawmvo was long now int
  variable fbfpwmvo was long now int
  variable fbalwmvo was long now int
  variable fbunwmvo was long now int
  variable millvote was long now int
  variable fbwmilvo was long now int
  variable tillit10 was long now int
  variable t1020tot was long now int
  variable tsch620 was long now int
  variable t69tot was long now int
  variable tsch69 was long now int
  variable t1014tot was long now int
  variable tsch1014 was long now int
  variable t1517tot was long now int
  variable tsch1517 was long now int
  variable t1820tot was long now int
  variable tsch1820 was long now int
  variable t614tot was long now int
  variable tsch614 was long now int
  variable nwnp614 was long now int
  variable nwnps614 was long now int
  variable nwfp614 was long now int
  variable nwfps614 was long now int
  variable fbw614 was long now int
  variable fbws614 was long now int
  variable pbwaustr was long now int
  variable pbwcanad was long now int
  variable pbwcanot was long now int
  variable pbwcenam was int now byte
  variable pbwengla was long now int
  variable pbwgerm was long now int
  variable pbwhung was long now int
  variable pbwirel was long now int
  variable pbwitaly was long now int
  variable pbwruss was long now int
  variable pbwswed was long now int
  variable nwfpaust was long now int
  variable nwfpcana was long now int
  variable nwfpgerm was long now int
  variable nwfpirel was long now int
  variable nwfpital was long now int
  variable nwfpruss was long now int
  variable nwfpswed was long now int
  variable nwfpoth was long now int
  variable tothomes was long now int
  variable t1415tot was long now int
  variable tsch1415 was long now int
  variable t1617tot was long now int
  variable tsch1617 was long now int
  variable fbnawm21 was long now int
  variable fbfpwm21 was long now int
  variable fbalwm21 was long now int
  variable othm21 was long now int
  variable fbnawf21 was long now int
  variable fbalwf21 was long now int
  variable othf21 was long now int
  variable t1620tot was long now int
  variable millit21 was long now int
  variable fbwmil21 was long now int
  variable fillit21 was long now int
  variable fbwfil21 was long now int
  variable pbwczech was long now int
  variable pbwlithu was long now int
  variable pbwpacif was int now byte
  variable pbwpolan was long now int
  variable pbwsoame was int now byte
  variable renthom was long now int
  variable ownhom was long now int
  variable ownfree was long now int
  variable ownmort was long now int
  variable m15widow was long now int
  variable f15widow was long now int
  variable f15divor was long now int
  variable pbweire was long now int
  variable totunemp was long now int
  variable munemp was long now int
  variable wholtemp was long now int
  variable wholmemp was long now int
  variable wholfemp was long now int
  variable retail was long now int
  variable retprop was long now int
  variable rettemp was long now int
  variable retstock was long now int
  variable retwages was long now int
  variable unemptot was long now int
  variable unempwm was long now int
  variable unempwf was long now int
  variable emergtot was long now int
  variable emergwm was long now int
  variable punempto was long now int
  variable punempwm was long now int
  variable unnfatot was long now int
  variable emnfatot was long now int
  variable punfatot was long now int
  variable fbnam21 was long now int
  variable fbalm21 was long now int
  variable fbnaf21 was long now int
  variable fbalf21 was long now int
  variable t56tot was long now int
  variable tsch56 was long now int
  variable m25edu0 was long now int
  variable m25edu14 was long now int
  variable m25edu56 was long now int
  variable m25hs13 was long now int
  variable m25hs4 was long now int
  variable m25col13 was long now int
  variable m25col4 was long now int
  variable f25edu0 was long now int
  variable f25edu14 was long now int
  variable f25edu56 was long now int
  variable f25hs13 was long now int
  variable f25hs4 was long now int
  variable f25col13 was long now int
  variable f25col4 was long now int
  variable m14self was long now int
  variable m14emerg was long now int
  variable m14seek was long now int
  variable f14seek was long now int
  variable m14eseek was long now int
  variable f14eseek was long now int
  variable mprof was long now int
  variable fprof was long now int
  variable mmanag was long now int
  variable mclerk was long now int
  variable fclerk was long now int
  variable mcraft was long now int
  variable moperat was long now int
  variable foperat was long now int
  variable fdomest was long now int
  variable mservoth was long now int
  variable fservoth was long now int
  variable mlabor was long now int
  variable servnsal was long now int
  variable servtemp was long now int
  variable servwage was long now int
  variable dwoccneg was long now int
  variable dwrenneg was long now int
  variable dwavail was long now int
  variable dwnotub was long now int
  variable tot_inducted_num was long now int
  variable tot_accepted_num was long now int
  variable germans was float now int
  variable dead_acc was int now byte
  variable dead_kia was int now byte
  variable dead_wnd was int now byte
  variable age18_40_amm was float now int
  variable age18_35_amm was float now int
  variable contractnum was int now byte
  variable n_food was int now byte
  variable Dgermans was float now int
  variable swedes was float now int
  variable italians was float now int
  variable english was float now int
  variable S was float now byte
  variable quincas5 was float now byte
  variable quin5post was float now byte
  variable treat was float now byte
  variable IV was float now byte
  variable wealth was double now byte
  variable fipsRC was double now long
  variable mfgrms2 was double now long
  variable wholnsal was double now long
  variable fips was double now long
  variable name was str22 now str17
  variable countyname was str13 now str11
  variable icpsrnam was str22 now str17
  variable statenam was str20 now str14
  variable nhgisnam was str36 now str19
  (10,114,881 bytes saved)

. save "$path/Replication/cleaned_data/county_panel_shortrun.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/county_panel_shortrun.dta saved

. 
. 
end of do-file

.         
.         * Generate the linked individual Census data
.         do "$path/Replication/1.D - Generate linked individual samples.do"

. clear all

. capture set more off

. 
. *******************************************************************************************************************************************
. // Admin
. *******************************************************************************************************************************************
. /*
>         // Set directory path
>         foreach i in "C:/Users/Andy/Dropbox/projects/WWI German Discrimination"         ///
>                                  "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"   ///
>                                  "Z:/Dropbox/projects/WWI German Discrimination"                                {
>                 
>                                 global path "`i'"
>                                 confirmdir "$path"
>                                 if `r(confirmdir)'==0 continue, break
>         }
> 
> */
. 
. /******************************************************************************************************************************************
> Merge the IPUMS sample with the crosswalks from the Census linking project for 1910 and 1920
> ******************************************************************************************************************************************/
. 
.         * full count sample for 1910 and 1920 from IPUMS for men who were born in the U.S., Germany, Switzerland, or Austria
.         use "$path/Replication/raw_data/usa_00081.dta"

. 
.         keep if year==1910
(32,459,164 observations deleted)

.         gen histid_1910 = histid

. 
.         * merge with the crosswalk from the Census linking project
.         merge 1:m histid_1910 using "$path/Replication/raw_data/crosswalk_1910_1920.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                    23,676,402
        from master                18,774,329  (_merge==1)
        from using                  4,902,073  (_merge==2)

    Matched                        11,290,801  (_merge==3)
    -----------------------------------------

.         keep if _merge==3
(23,676,402 observations deleted)

. 
.         drop _merge

. 
.         * keep Germans in 1910
.         preserve

. 
.                 keep if bpl==426 | bpl==450 | bpl==453
(10,846,845 observations deleted)

. 
.                 compress
  variable gqtyped was int now byte
  variable age was int now byte
  variable mtongued was int now byte
  variable abe_exact_standard was float now byte
  variable abe_nysiis_standard was float now byte
  variable abe_exact_conservative was float now byte
  variable abe_nysiis_conservative was float now byte
  variable abe_race_nysiis_standard was float now byte
  variable abe_race_nysiis_conservative was float now byte
  (9,323,076 bytes saved)

.                 save "$path/Replication/cleaned_data/germans1910.dta", replace
(file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/germans1910.dta not found)
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/germans1910.dta saved

.         restore

. 
.         * keep Americans in 1910
.         drop if bpl==426 | bpl==450 | bpl==453
(443,956 observations deleted)

.         compress
  variable gqtyped was int now byte
  variable bpl was int now byte
  variable bpld was long now int
  variable mtongued was int now byte
  variable abe_exact_standard was float now byte
  variable abe_nysiis_standard was float now byte
  variable abe_exact_conservative was float now byte
  variable abe_nysiis_conservative was float now byte
  variable abe_race_nysiis_standard was float now byte
  variable abe_race_nysiis_conservative was float now byte
  (249,477,435 bytes saved)

.         save "$path/Replication/cleaned_data/americans1910.dta", replace
(file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/americans1910.dta not found)
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/americans1910.dta saved

.         clear

. 
. 
.         * now do the same for 1920
.         use "$path/Replication/raw_data/usa_00081.dta"

. 
.         keep if year==1920
(29,853,788 observations deleted)

.         gen histid_1920 = histid

. 
.         merge 1:m histid_1920 using "$path/Replication/raw_data/crosswalk_1910_1920.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                    27,022,837
        from master                21,764,263  (_merge==1)
        from using                  5,258,574  (_merge==2)

    Matched                        10,934,300  (_merge==3)
    -----------------------------------------

.         keep if _merge==3
(27,022,837 observations deleted)

. 
.         drop _merge

. 
.         * keep Germans in 1920
.         preserve

. 
.                 keep if bpl==426 | bpl==450 | bpl==453
(10,495,758 observations deleted)

. 
.                 compress
  variable languaged was int now byte
  variable abe_exact_standard was float now byte
  variable abe_nysiis_standard was float now byte
  variable abe_exact_conservative was float now byte
  variable abe_nysiis_conservative was float now byte
  variable abe_race_nysiis_standard was float now byte
  variable abe_race_nysiis_conservative was float now byte
  (8,332,298 bytes saved)

.                 save "$path/Replication/cleaned_data/germans1920.dta", replace
(file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/germans1920.dta not found)
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/germans1920.dta saved

.         restore

. 
.         * keep Americans in 1920
.         drop if bpl==426 | bpl==450 | bpl==453
(438,542 observations deleted)

.         compress
  variable bpl was int now byte
  variable bpld was long now int
  variable mtongued was int now byte
  variable languaged was int now byte
  variable abe_exact_standard was float now byte
  variable abe_nysiis_standard was float now byte
  variable abe_exact_conservative was float now byte
  variable abe_nysiis_conservative was float now byte
  variable abe_race_nysiis_standard was float now byte
  variable abe_race_nysiis_conservative was float now byte
  (241,402,434 bytes saved)

.         save "$path/Replication/cleaned_data/americans1920.dta", replace
(file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/americans1920.dta not found)
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/americans1920.dta saved

.         clear

.         
. 
. 
. /******************************************************************************************************************
> Append the 1910 and 1920 samples into a panel
> ******************************************************************************************************************/
. 
. * for Germans
.         use "$path/Replication/cleaned_data/germans1910.dta"

.         append using "$path/Replication/cleaned_data/germans1920.dta"
(variable gqtyped was byte, now int to accommodate using data's values)
(variable age was byte, now int to accommodate using data's values)
(variable mtongued was byte, now int to accommodate using data's values)
(label YEAR already defined)
(label SAMPLE already defined)
(label STATEICP already defined)
(label STATEFIP already defined)
(label URBAN already defined)
(label METRO already defined)
(label CITY already defined)
(label GQ already defined)
(label GQTYPE already defined)
(label GQTYPED already defined)
(label FARM already defined)
(label OWNERSHP already defined)
(label OWNERSHPD already defined)
(label MORTGAGE already defined)
(label FAMSIZE already defined)
(label SEX already defined)
(label AGE already defined)
(label MARST already defined)
(label RACE already defined)
(label RACED already defined)
(label BPL already defined)
(label BPLD already defined)
(label MBPL already defined)
(label MBPLD already defined)
(label FBPL already defined)
(label FBPLD already defined)
(label NATIVITY already defined)
(label CITIZEN already defined)
(label YRSUSA1 already defined)
(label YRSUSA2 already defined)
(label MTONGUE already defined)
(label MTONGUED already defined)
(label LANGUAGE already defined)
(label LANGUAGED already defined)
(label SPEAKENG already defined)
(label SCHOOL already defined)
(label LIT already defined)
(label EMPSTAT already defined)
(label EMPSTATD already defined)
(label LABFORCE already defined)
(label CLASSWKR already defined)
(label CLASSWKRD already defined)
(label OCC1950 already defined)
(label IND1950 already defined)
(label VERSIONHIST already defined)

. 
.         * keep those who have exactly two observations
.         egen id = group(histid_1910 histid_1920)

.         gen n = 1

.         egen sumn = sum(n), by(id)

.         keep if sumn==2
(12,148 observations deleted)

.         drop n sumn

.         
.         compress
  (0 bytes saved)

.         save "$path/Replication/cleaned_data/germans1910-20_linked.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/germans1910-20_linked.dta saved

. 
.         erase "$path/Replication/cleaned_data/germans1910.dta"

.         erase "$path/Replication/cleaned_data/germans1920.dta"

. 
. * for Americans
.         use "$path/Replication/cleaned_data/americans1910.dta"

.         append using "$path/Replication/cleaned_data/americans1920.dta"
(variable gqtyped was byte, now int to accommodate using data's values)
(label VERSIONHIST already defined)
(label IND1950 already defined)
(label OCC1950 already defined)
(label CLASSWKRD already defined)
(label CLASSWKR already defined)
(label LABFORCE already defined)
(label EMPSTATD already defined)
(label EMPSTAT already defined)
(label LIT already defined)
(label SCHOOL already defined)
(label SPEAKENG already defined)
(label LANGUAGED already defined)
(label LANGUAGE already defined)
(label MTONGUED already defined)
(label MTONGUE already defined)
(label YRSUSA2 already defined)
(label YRSUSA1 already defined)
(label CITIZEN already defined)
(label NATIVITY already defined)
(label FBPLD already defined)
(label FBPL already defined)
(label MBPLD already defined)
(label MBPL already defined)
(label BPLD already defined)
(label BPL already defined)
(label RACED already defined)
(label RACE already defined)
(label MARST already defined)
(label AGE already defined)
(label SEX already defined)
(label FAMSIZE already defined)
(label MORTGAGE already defined)
(label OWNERSHPD already defined)
(label OWNERSHP already defined)
(label FARM already defined)
(label GQTYPED already defined)
(label GQTYPE already defined)
(label GQ already defined)
(label CITY already defined)
(label METRO already defined)
(label URBAN already defined)
(label STATEFIP already defined)
(label STATEICP already defined)
(label SAMPLE already defined)
(label YEAR already defined)

. 
.         * keep those who have exactly two observations
.         egen id = group( histid_1910 histid_1920)

.         gen n = 1

.         egen sumn = sum(n), by(id)

.         keep if sumn==2
(1,867,451 observations deleted)

.         drop n sumn

.         
.         compress
  (0 bytes saved)

.         save "$path/Replication/cleaned_data/americans1910-20_linked.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/americans1910-20_linked.dta saved

. 
.         erase "$path/Replication/cleaned_data/americans1910.dta"

.         erase "$path/Replication/cleaned_data/americans1920.dta"

.         clear

. 
end of do-file

.         
.         * Clean and prep the linked data to generate the estimation samples for the German and American workers
.         do "$path/Replication/1.D.1 - Generate linked individual estimation samples - Germans.do"

. clear all

. capture set more off

. 
. *******************************************************************************************************************************************
. // Admin
. *******************************************************************************************************************************************
. /*
>         // Set directory path
>         foreach i in "C:/Users/Andy/Dropbox/projects/WWI German Discrimination"         ///
>                                  "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"   ///
>                                  "Z:/Dropbox/projects/WWI German Discrimination"                                {
>                 
>                                 global path "`i'"
>                                 confirmdir "$path"
>                                 if `r(confirmdir)'==0 continue, break
>         }
> */
. 
. *******************************************************************************************************************************************
. // Merge linked Census data with casualty, geographic, and aggregate Census controls and generate relevant variables
. *******************************************************************************************************************************************
. 
.         * load the linked 1910-20 Census data for German individuals
.         use "$path/Replication/cleaned_data/germans1910-20_linked.dta"

. 
.         * make sure each person is unique
.         duplicates tag histid_1910 year, gen(tag10)

Duplicates in terms of histid_1910 year

.         duplicates tag histid_1920 year, gen(tag20)

Duplicates in terms of histid_1920 year

.         drop if tag10==1 | tag20==1
(74,150 observations deleted)

.         drop tag10 tag20

.         
.         * generate county variable
.         gen county = countyicp

.         gen stcounty = 10000*statefip + county

.         
.         * fix county fips codes that changed between 1910-20
.         replace stcounty = stcounty/10
(796,200 real changes made)

.         ren stcounty fips

. 
.         qui do "$path/Replication/code/standardize_county_boundaries_to_1910.do"  

.         
.         * merge with the WWI casualty information by county
.         merge m:1 fips using "$path/Replication/cleaned_data/WWI casualties Army Navy clean - county.dta"
(variable fips was float, now double to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                         2,038
        from master                     1,715  (_merge==1)
        from using                        323  (_merge==2)

    Matched                           794,485  (_merge==3)
    -----------------------------------------

.         keep if _merge==3
(2,038 observations deleted)

.         drop _merge

.         
.         * merge with the WWI draft information by county
.         gen statefips = statefip

.         merge m:1 statefips county using "$path/Replication/cleaned_data/WWI inductions by county - clean.dta" 

    Result                      Number of obs
    -----------------------------------------
    Not matched                        75,025
        from master                    74,619  (_merge==1)
        from using                        406  (_merge==2)

    Matched                           719,866  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(406 observations deleted)

.         drop _merge

.         
.         * merge with granular age distribution info in 1910
.         merge m:1 fips using "$path/Replication/raw_data/age_distribution.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                           508
        from master                       103  (_merge==1)
        from using                        405  (_merge==2)

    Matched                           794,382  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(405 observations deleted)

.         drop _merge

.         
.         * merge with latitude and longitude data
.         gen icpsrfip = fips

.         merge m:1 icpsrfip county using "$path/Replication/raw_data/county_lat_lon.dta"
(variable state was byte, now int to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                        54,834
        from master                    54,279  (_merge==1)
        from using                        555  (_merge==2)

    Matched                           740,206  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(555 observations deleted)

.         drop _merge

.         
.         * add German names
.         merge m:1 histid_1910 histid_1920 year using "$path/Replication/raw_data/linked_german_names_anonymized.dta"
(label YEAR already defined)

    Result                      Number of obs
    -----------------------------------------
    Not matched                        75,865
        from master                         0  (_merge==1)
        from using                     75,865  (_merge==2)

    Matched                           794,485  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(75,865 observations deleted)

.         drop _merge

. 
.         
.         * sum men aged 18-45 during the war years
.         egen age18_45_amm = rowtotal(am_10- am_37)

.         
.         * generate the top quintile casualty rate variable times post
.         gen casrate2 = dead_all/age18_45_amm*100 if year==1910
(397,433 missing values generated)

.         egen casualtyrate2 = max(casrate2), by(id)
(749 missing values generated)

.         replace casualtyrate2 = 0 if year==1910
(397,052 real changes made)

.         
.         xtile k2 = casualtyrate2, nq(5)

.         gen treat = (k2==5)*(year==1920)

.         
.         * draft rate times post
.         gen drate2 = tot_accepted_num/age18_45_amm*100 if year==1910
(429,110 missing values generated)

.         replace drate2 = 100 if drate2>100 & drate!=.
(876 real changes made)

.         egen draftrate2 = max(drate2), by(id)
(64,092 missing values generated)

.         replace draftrate2 = 0 if year==1910
(397,052 real changes made)

.         drop k2 drate2 all_* am_*

.         
.         ren (casualtyrate2 draftrate2) (casualtyrate draftrate)

.         
.         // dummy for whether individual moved county between 1910 and 1920
.         egen moved = sd(fips), by(id)
(1,117 missing values generated)

. 
.         cap drop mover

.         gen mover = moved!=0

. 
.         replace mover = 0 if year==1910
(208,626 real changes made)

. 
. 
.         // define skill groups and label them for convenience
.         gen skill =  1*(occ1950<100)                            + /// 
>                                  2*(occ1950>=100 & occ1950<200) + ///
>                                  3*(occ1950>=200 & occ1950<300) + ///
>                                  4*(occ1950>=300 & occ1950<400) + ///
>                                  5*(occ1950>=400 & occ1950<500) + ///
>                                  6*(occ1950>=500 & occ1950<600) + ///
>                                  7*(occ1950>=600 & occ1950<700) + ///
>                                  8*(occ1950>=700 & occ1950<800) + ///
>                                  9*(occ1950>=800 & occ1950<900) + ///
>                                 10*(occ1950>=900 & occ1950<979) + ///
>                                 11*(occ1950>=979 & occ1950!=.)

. 
.         label def skillab 1  "Professional, Technical"                  ///
>                                           2  "Farmers"                                                  ///
>                                           3  "Managers, Officials, Proprietors" ///
>                                           4  "Clerical and Kindred"                             ///
>                                           5  "Sales workers"                                    ///
>                                           6  "Craftsmen"                                                ///
>                                           7  "Operatives"                                               ///
>                                           8  "Service Workers (priv househ)"    ///
>                                           9  "Farm Laborers"                                    ///
>                                           10 "Laborers"                                                 ///
>                                           11 "Non-occupational response"

. 
.         label val skill skillab

.         
.         // define industry groups and label them for convenience
.         gen industry =  1*(ind1950>=100 & ind1950<127) + ///
>                                         2*(ind1950>=127 & ind1950<240) + ///
>                                         3*(ind1950>=240 & ind1950<300) + ///
>                                         4*(ind1950>=300 & ind1950<400) + ///
>                                         5*(ind1950>=400 & ind1950<500) + ///
>                                         6*(ind1950>=500 & ind1950<569) + ///
>                                         7*(ind1950>=569 & ind1950<580) + ///
>                                         8*(ind1950>=580 & ind1950<600) + ///
>                                         9*(ind1950>=600 & ind1950<628) + ///
>                                    10*(ind1950>=628 & ind1950<700) + ///
>                                    11*(ind1950>=700 & ind1950<757) + ///
>                                    12*(ind1950>=757 & ind1950<818) + ///
>                                    13*(ind1950>=818 & ind1950<850) + ///
>                                    14*(ind1950>=850 & ind1950<860) + ///
>                                    15*(ind1950>=860 & ind1950<900) + ///
>                                    16*(ind1950>=900 & ind1950<947) + ///
>                                    17*(ind1950>=947 & ind1950<979) + ///
>                                    18*(ind1950>=979 & ind1950!=.)

. 
.         label def indlab 0  "N/A or none reported"                              ///
>                                          1  "Agriculture, Forestry, Fishing"    ///
>                                          2  "Mining"                                                    ///
>                                          3  "Construction"                                              ///
>                                          4  "Manufacturing (dur.)"                              ///
>                                          5  "Manufacturing (nondur.)"                   ///
>                                          6  "Transportation"                                    ///
>                                          7  "Telecommunications"                                ///
>                                          8  "Utilities, Sanitary Services"              ///
>                                          9  "Wholesale Trade"                                   ///
>                                          10 "Retail Trade"                                              ///
>                                          11 "Finance, Insurance, Real Estate"   ///
>                                          12 "Business and Repair Services"              ///
>                                          13 "Personal services"                                 ///
>                                          14 "Entertainment/Recreation Services" ///
>                                          15 "Professional and Related Services" ///
>                                          16 "Public Administration"                             ///
>                                          17 "Not yet specified"                                 ///
>                                          18 "Others"

. 
.         label val industry indlab

.         
.         // generate 1910 baseline characteristics
.         qui foreach var in urban skill industry farm  classwkr lit marst yrsusa2 statefip empstat famsize wksunemp  school labforce  fips {

.         
.         // define baseline categories for 1910 variables interacted with 1920 dummy
.         replace urban1910    = 0 if urban1910==1         // rural
(143,627 real changes made)

.         replace skill1910    = 0 if skill1910==11        // non-occ response
(96,303 real changes made)

.         replace farm1910     = 0 if farm1910==1          // non-farm
(312,553 real changes made)

.         replace empstat1910  = 0 if empstat1910==30      // not in labor force
(0 real changes made)

.         replace lit1910          = 0 if lit1910==1               // illiterate
(15,536 real changes made)

.         replace marst1910        = 0 if marst1910==6     // single
(91,150 real changes made)

.         replace yrsusa21910  = 0 if yrsusa21910==5       // 21+ yrs
(230,858 real changes made)

.         replace statefip1910 = 0 if statefip1910==48 // Texas
(6,819 real changes made)

.         replace fips1910         = 0 if fips1910==42003  // Allegheny county, Pennsylvania
(8,888 real changes made)

.         replace school1910       = 0 if school1910==1    // not in school
(381,671 real changes made)

.         replace labforce1910 = 0 if labforce1910==1      // not in labor force
(25,047 real changes made)

. 
.         label val industry1910 indlab

.         label val skill1910 skillab

.         
.         * does not speak English in 1910
.         gen nospeakeng10 = speakeng==1 & year==1910

.         egen maxnospeakeng10 = max(nospeakeng10), by(id)

. 
.         * manufacturing worker
.         gen mfg10 = industry1910==4 | industry1910==5

.         egen maxmfg10 = max(mfg10), by(id)

. 
.         * indicator for movers
.         egen maxmover = max(mover), by(id)

. 
.         * distance moved in miles
.         gen point_x10 = point_x if year==1910
(397,433 missing values generated)

.         gen point_y10 = point_y if year==1910
(397,433 missing values generated)

.         egen point_x1910 = max(point_x10), by(id)
(749 missing values generated)

.         egen point_y1910 = max(point_y10), by(id)
(749 missing values generated)

. 
.         geodist point_y point_x point_y1910 point_x1910 if year==1920, gen(dist) mi

.         replace dist = 0 if year==1910
(397,052 real changes made)

.         
.         * dummy for no naturalization
.         gen nonat = citizen==3 | citizen==4

.         
.         * dummy for no English language skills
.         gen noeng = speakeng==1

.         
.         * dummy for changing from non-agricultural (1910) to agricultural job (1920)    
.         egen agri10 = max(industry1910==1), by(id)

.         gen farmer = industry==1 & year==1920 & agri10==0

.         
.         * dummy for leaving the midwest from 1910 to 1920
.         gen midwest = statename=="Ohio" | statename=="Indiana" | statename=="Michigan" | statename=="Illinois" | statename=="Wisconsin" | statename=="Missouri" | statename=="Iowa" | statename=="Minnesota" | statename==
> "North Dakota" | statename=="South Dakota" | statename=="Nebraska" | statename=="Kansas"

.         gen notmidwest = midwest==0

.         gen notmidwest20 = notmidwest==1 & year==1920

. 
.         * make sure the sample is consistent, i.e. each individual is unique, available in both 1910 and 1920, and no missings in key variables
.         global controls "c.draftrate i.urban1910 i.skill1910 i.farm1910 i.empstat1910 i.lit1910 i.marst1910 i.yrsusa21910 c.famsize1910 i.school1910 i.labforce1910 c.wksunemp1910"

. 
.         gen missdist = dist==.

.         replace dist = 0 if dist==.
(54,947 real changes made)

. 
.         reghdfe dist treat $controls missdist i.year if maxmover==1 & abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(dropped 232 singleton observations)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    311,711
Absorbing 3 HDFE groups                           F(  29,   2450) =      35.68
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.4626
                                                  Adj R-squared   =     0.4589
                                                  Within R-sq.    =     0.1646
Number of clusters (fips)    =      2,451         Root MSE        =   329.6870

                                                    (Std. err. adjusted for 2,451 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                             dist | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   457.6723   37.36528    12.25   0.000     384.4015    530.9431
                        draftrate |          0  (omitted)
                      2.urban1910 |   19.94646   7.202765     2.77   0.006     5.822319     34.0706
                                  |
                        skill1910 |
         Professional, Technical  |  -30.65955   13.38477    -2.29   0.022    -56.90619   -4.412907
                         Farmers  |  -21.46291   11.43547    -1.88   0.061    -43.88709    .9612703
Managers, Officials, Proprietors  |  -5.653849   8.012022    -0.71   0.480    -21.36488    10.05719
            Clerical and Kindred  |  -4.873898   12.94716    -0.38   0.707    -30.26241    20.51461
                   Sales workers  |   8.536407   10.98772     0.78   0.437    -13.00978    30.08259
                       Craftsmen  |   -2.02254   8.017755    -0.25   0.801    -17.74482    13.69974
                      Operatives  |  -2.287757   9.016374    -0.25   0.800    -19.96826    15.39275
   Service Workers (priv househ)  |   8.266352   10.76197     0.77   0.442    -12.83715    29.36986
                   Farm Laborers  |   1.895913   11.91144     0.16   0.874    -21.46162    25.25344
                        Laborers  |    12.6565   11.19337     1.13   0.258    -9.292955    34.60595
                                  |
                       2.farm1910 |  -24.39617   7.086928    -3.44   0.001    -38.29315   -10.49918
                                  |
                      empstat1910 |
                               1  |   .8901084    6.99165     0.13   0.899    -12.82005    14.60026
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |   20.46443   15.42951     1.33   0.185      -9.7918    50.72066
                               4  |    11.2913   6.792102     1.66   0.097    -2.027551    24.61016
                                  |
                        marst1910 |
                               1  |  -35.81968   7.160374    -5.00   0.000    -49.86069   -21.77866
                               2  |   -12.3243    7.34596    -1.68   0.094    -26.72923    2.080637
                               4  |  -7.014673    23.3745    -0.30   0.764    -52.85049    38.82115
                               5  |   -17.6141   8.207839    -2.15   0.032    -33.70913   -1.519084
                                  |
                      yrsusa21910 |
                               1  |  -10.82859   6.283273    -1.72   0.085    -23.14967    1.492486
                               2  |  -12.08747   6.796114    -1.78   0.075    -25.41419    1.239255
                               3  |  -9.610028   5.532654    -1.74   0.083    -20.45919    1.239134
                               4  |  -4.546181   3.902814    -1.16   0.244    -12.19934    3.106975
                                  |
                      famsize1910 |  -2.006474   .6789947    -2.96   0.003    -3.337937   -.6750113
                     2.school1910 |  -32.58908    12.0678    -2.70   0.007    -56.25322   -8.924939
                   2.labforce1910 |   6.722958   5.761305     1.17   0.243    -4.574574    18.02049
                     wksunemp1910 |   .1442341   .0476179     3.03   0.002     .0508587    .2376095
                         missdist |  -579.2433   37.29734   -15.53   0.000    -652.3809   -506.1058
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   195.6534   6.218906    31.46   0.000     183.4585    207.8483
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2014           0        2014     |
     birthyr |        93           1          92     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.         gen K = e(sample)

.         egen sumK = sum(K), by(id)

. 
.         reghdfe mover treat $controls i.year if abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(dropped 201 singleton observations)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    609,469
Absorbing 3 HDFE groups                           F(  28,   2498) =     171.80
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.5037
                                                  Adj R-squared   =     0.5018
                                                  Within R-sq.    =     0.0896
Number of clusters (fips)    =      2,499         Root MSE        =     0.3017

                                                    (Std. err. adjusted for 2,499 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                            mover | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |     .56611   .2131093     2.66   0.008      .148221    .9839991
                        draftrate |          0  (omitted)
                      2.urban1910 |  -.0209375   .0042838    -4.89   0.000    -.0293376   -.0125374
                                  |
                        skill1910 |
         Professional, Technical  |   .0794044   .0115066     6.90   0.000     .0568409    .1019679
                         Farmers  |  -.0068216   .0107702    -0.63   0.527     -.027941    .0142977
Managers, Officials, Proprietors  |   .0054463   .0060901     0.89   0.371    -.0064959    .0173885
            Clerical and Kindred  |  -.0082677   .0065997    -1.25   0.210    -.0212091    .0046737
                   Sales workers  |   .0114332   .0072951     1.57   0.117    -.0028718    .0257382
                       Craftsmen  |   .0105876   .0061831     1.71   0.087    -.0015369    .0227121
                      Operatives  |   .0419732   .0087992     4.77   0.000     .0247188    .0592277
   Service Workers (priv househ)  |   .0244959   .0071948     3.40   0.001     .0103875    .0386044
                   Farm Laborers  |   .0532199   .0063741     8.35   0.000     .0407208     .065719
                        Laborers  |   .0969863   .0075038    12.92   0.000     .0822719    .1117007
                                  |
                       2.farm1910 |  -.0385544   .0045086    -8.55   0.000    -.0473954   -.0297134
                                  |
                      empstat1910 |
                               1  |  -.0230958   .0047653    -4.85   0.000    -.0324402   -.0137514
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |  -.0227323   .0091116    -2.49   0.013    -.0405993   -.0048653
                               4  |  -.0548912   .0070729    -7.76   0.000    -.0687605   -.0410218
                                  |
                        marst1910 |
                               1  |  -.1009449   .0045769   -22.06   0.000    -.1099199     -.09197
                               2  |   .0426648    .005328     8.01   0.000     .0322171    .0531125
                               4  |    .002834   .0146139     0.19   0.846    -.0258225    .0314906
                               5  |  -.0392903   .0052172    -7.53   0.000    -.0495207     -.02906
                                  |
                      yrsusa21910 |
                               1  |      .1892   .0155047    12.20   0.000     .1587966    .2196033
                               2  |   .1424669   .0121458    11.73   0.000       .11865    .1662838
                               3  |   .0893964   .0066728    13.40   0.000     .0763116    .1024812
                               4  |   .0408476   .0030094    13.57   0.000     .0349465    .0467487
                                  |
                      famsize1910 |  -.0130427   .0004606   -28.31   0.000    -.0139459   -.0121394
                     2.school1910 |  -.0332086   .0055127    -6.02   0.000    -.0440186   -.0223987
                   2.labforce1910 |   .0211541   .0044716     4.73   0.000     .0123857    .0299226
                     wksunemp1910 |   -.000124   .0000257    -4.82   0.000    -.0001745   -.0000735
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .1998102   .0397479     5.03   0.000     .1218679    .2777524
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2156           0        2156     |
     birthyr |        94           1          93     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.         gen J = e(sample)

.         egen sumJ = sum(J), by(id)

. 
.         gen D = (sumK==2 & sumJ==2) | (sumK==0 & sumJ==2)

.         keep if D==1
(210,893 observations deleted)

.         
.         compress
  variable county was float now int
  variable statefips was float now byte
  variable state was int now byte
  variable germansurname_match was float now byte
  variable germanfirstname_match was float now byte
  variable ger_surname was float now byte
  variable wilhelm was float now byte
  variable wilhelmfrst was float now byte
  variable frstname_change was float now byte
  variable lasttname_change was float now byte
  variable comlasttname_change was float now byte
  variable wilhelmlast_change was float now byte
  variable wilhelmfirst_change was float now byte
  variable treat was float now byte
  variable mover was float now byte
  variable skill was float now byte
  variable industry was float now byte
  variable urban1910 was float now byte
  variable skill1910 was float now byte
  variable industry1910 was float now byte
  variable farm1910 was float now byte
  variable classwkr1910 was float now byte
  variable lit1910 was float now byte
  variable marst1910 was float now byte
  variable yrsusa21910 was float now byte
  variable statefip1910 was float now byte
  variable empstat1910 was float now byte
  variable famsize1910 was float now byte
  variable wksunemp1910 was float now byte
  variable school1910 was float now byte
  variable labforce1910 was float now byte
  variable nospeakeng10 was float now byte
  variable maxnospeakeng10 was float now byte
  variable mfg10 was float now byte
  variable maxmfg10 was float now byte
  variable maxmover was float now byte
  variable nonat was float now byte
  variable noeng was float now byte
  variable agri10 was float now byte
  variable farmer was float now byte
  variable midwest was float now byte
  variable notmidwest was float now byte
  variable notmidwest20 was float now byte
  variable missdist was float now byte
  variable K was float now byte
  variable sumK was float now byte
  variable J was float now byte
  variable sumJ was float now byte
  variable D was float now byte
  variable fips was double now long
  variable name was str19 now str16
  variable nhgisnam was str36 now str25
  variable icpsrnam was str22 now str17
  (97,459,864 bytes saved)

.         save "$path/Replication/cleaned_data/linked_Germans_estimation_sample.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/linked_Germans_estimation_sample.dta saved

.         clear

.         
. 
end of do-file

.         do "$path/Replication/1.D.2 - Generate linked individual estimation samples - Americans.do"

. clear all

. capture set more off

. 
. *******************************************************************************************************************************************
. // Admin
. *******************************************************************************************************************************************
. /*
>         // Set directory path
>         foreach i in "C:/Users/Andy/Dropbox/projects/WWI German Discrimination"         ///
>                                  "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"   ///
>                                  "Z:/Dropbox/projects/WWI German Discrimination"                                {
>                 
>                                 global path "`i'"
>                                 confirmdir "$path"
>                                 if `r(confirmdir)'==0 continue, break
>         }
> */
. 
. *******************************************************************************************************************************************
. // Merge linked Census data with casualty, geographic, and aggregate Census controls and generate relevant variables
. *******************************************************************************************************************************************
. 
.         * load Census data
.                 use "$path/Replication/cleaned_data/americans1910-20_linked.dta"

.                 
.                 * keep men of working age in the labor force
.                 keep if age>15 & age<66
(6,975,366 observations deleted)

.                 
.                 drop if labforce==1
(1,140,733 observations deleted)

.                 
.                 duplicates tag histid_1910 year, gen(tag10)

Duplicates in terms of histid_1910 year

.                 duplicates tag histid_1920 year, gen(tag20)

Duplicates in terms of histid_1920 year

.                 drop if tag10==1 | tag20==1
(547,729 observations deleted)

.                 drop tag10 tag20

.                 
.                 * keep those who have a full panel (2 periods)
.                 bysort id: gen n = _n

.                 egen maxn = max(n), by(id)

.                 keep if maxn==2
(2,593,344 observations deleted)

.                 drop n maxn

.                 
.                 gen county = countyicp

.                 *drop stcounty
.                 gen stcounty = 10000*statefip + county

.                 
.                 
.                 
. 
.         * fix county codes to 1910 county codes
.                 replace stcounty = stcounty/10
(8,217,980 real changes made)

.                 ren stcounty fips

. 
.                 qui do "$path/Replication/code/standardize_county_boundaries_to_1910.do"  

. 
.         * merge with the WWI casualty information by county
.                 merge m:1 fips using "$path/Replication/cleaned_data/WWI casualties Army Navy clean - county.dta"
(variable fips was float, now double to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                        40,149
        from master                    40,134  (_merge==1)
        from using                         15  (_merge==2)

    Matched                         8,177,846  (_merge==3)
    -----------------------------------------

.                 keep if _merge==3
(40,149 observations deleted)

.                 drop _merge

. 
.         * merge with the WWI draft information by county
.                 gen statefips = statefip

.                 merge m:1 statefips county using "$path/Replication/cleaned_data/WWI inductions by county - clean.dta" 

    Result                      Number of obs
    -----------------------------------------
    Not matched                       326,046
        from master                   325,969  (_merge==1)
        from using                         77  (_merge==2)

    Matched                         7,851,877  (_merge==3)
    -----------------------------------------

.                 drop if _merge==2
(77 observations deleted)

.                 drop _merge

.                 
.         * merge with latitude and longitude data
.                 gen icpsrfip = fips

.                 merge m:1 icpsrfip county using "$path/Replication/raw_data/county_lat_lon.dta"
(variable state was byte, now int to accommodate using data's values)

    Result                      Number of obs
    -----------------------------------------
    Not matched                       279,476
        from master                   279,235  (_merge==1)
        from using                        241  (_merge==2)

    Matched                         7,898,611  (_merge==3)
    -----------------------------------------

.                 drop if _merge==2
(241 observations deleted)

.                 drop _merge

. 
.                 
.         * merge with granular age distribution info in 1910
.                 merge m:1 fips using "$path/Replication/raw_data/age_distribution.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                         2,904
        from master                     2,807  (_merge==1)
        from using                         97  (_merge==2)

    Matched                         8,175,039  (_merge==3)
    -----------------------------------------

.                 drop if _merge==2
(97 observations deleted)

.                 drop _merge

.                 
.                 egen age18_45_amm = rowtotal(am_10- am_37)

.                 
. 
.                 gen casrate2 = dead_all/age18_45_amm*100 if year==1910
(4,087,783 missing values generated)

.                 egen casualtyrate2 = max(casrate2), by(id)
(9,673 missing values generated)

.                 replace casualtyrate2 = 0 if year==1910
(4,090,063 real changes made)

.                 
.                 xtile k2 = casualtyrate2, nq(5)

.                 gen treat2 = (k2==5)*(year==1920)

.                 
.                 
.                 gen drate2 = tot_accepted_num/age18_45_amm*100 if year==1910
(4,237,445 missing values generated)

.                 replace drate2 = 100 if drate2>100 & drate!=.
(5,684 real changes made)

.                 egen draftrate2 = max(drate2), by(id)
(308,767 missing values generated)

.                 replace draftrate2 = 0 if year==1910
(4,090,063 real changes made)

.                 drop k2 drate2 all_* am_*

.                 
.                 ren (treat2 casualtyrate2 draftrate2) (treat casualtyrate draftrate)

. 
.                 
. 
.         // dummy for whether individual moved county between 1910 and 1920
.         egen moved = sd(fips), by(id)
(21,626 missing values generated)

. 
.         cap drop mover

.         gen mover = moved!=0

. 
.         replace mover = 0 if year==1910
(1,754,520 real changes made)

. 
. 
.         // define skill groups and label them for convenience
.         gen skill =  1*(occ1950<100)                            + /// 
>                                  2*(occ1950>=100 & occ1950<200) + ///
>                                  3*(occ1950>=200 & occ1950<300) + ///
>                                  4*(occ1950>=300 & occ1950<400) + ///
>                                  5*(occ1950>=400 & occ1950<500) + ///
>                                  6*(occ1950>=500 & occ1950<600) + ///
>                                  7*(occ1950>=600 & occ1950<700) + ///
>                                  8*(occ1950>=700 & occ1950<800) + ///
>                                  9*(occ1950>=800 & occ1950<900) + ///
>                                 10*(occ1950>=900 & occ1950<979) + ///
>                                 11*(occ1950>=979 & occ1950!=.)

. 
.         label def skillab 1  "Professional, Technical"                  ///
>                                           2  "Farmers"                                                  ///
>                                           3  "Managers, Officials, Proprietors" ///
>                                           4  "Clerical and Kindred"                             ///
>                                           5  "Sales workers"                                    ///
>                                           6  "Craftsmen"                                                ///
>                                           7  "Operatives"                                               ///
>                                           8  "Service Workers (priv househ)"    ///
>                                           9  "Farm Laborers"                                    ///
>                                           10 "Laborers"                                                 ///
>                                           11 "Non-occupational response"

. 
.         label val skill skillab

. 
. 
.         // define industry groups and label them for convenience
.         gen industry =  1*(ind1950>=100 & ind1950<127) + ///
>                                         2*(ind1950>=127 & ind1950<240) + ///
>                                         3*(ind1950>=240 & ind1950<300) + ///
>                                         4*(ind1950>=300 & ind1950<400) + ///
>                                         5*(ind1950>=400 & ind1950<500) + ///
>                                         6*(ind1950>=500 & ind1950<569) + ///
>                                         7*(ind1950>=569 & ind1950<580) + ///
>                                         8*(ind1950>=580 & ind1950<600) + ///
>                                         9*(ind1950>=600 & ind1950<628) + ///
>                                    10*(ind1950>=628 & ind1950<700) + ///
>                                    11*(ind1950>=700 & ind1950<757) + ///
>                                    12*(ind1950>=757 & ind1950<818) + ///
>                                    13*(ind1950>=818 & ind1950<850) + ///
>                                    14*(ind1950>=850 & ind1950<860) + ///
>                                    15*(ind1950>=860 & ind1950<900) + ///
>                                    16*(ind1950>=900 & ind1950<947) + ///
>                                    17*(ind1950>=947 & ind1950<979) + ///
>                                    18*(ind1950>=979 & ind1950!=.)

. 
.         label def indlab 0  "N/A or none reported"                              ///
>                                          1  "Agriculture, Forestry, Fishing"    ///
>                                          2  "Mining"                                                    ///
>                                          3  "Construction"                                              ///
>                                          4  "Manufacturing (dur.)"                              ///
>                                          5  "Manufacturing (nondur.)"                   ///
>                                          6  "Transportation"                                    ///
>                                          7  "Telecommunications"                                ///
>                                          8  "Utilities, Sanitary Services"              ///
>                                          9  "Wholesale Trade"                                   ///
>                                          10 "Retail Trade"                                              ///
>                                          11 "Finance, Insurance, Real Estate"   ///
>                                          12 "Business and Repair Services"              ///
>                                          13 "Personal services"                                 ///
>                                          14 "Entertainment/Recreation Services" ///
>                                          15 "Professional and Related Services" ///
>                                          16 "Public Administration"                             ///
>                                          17 "Not yet specified"                                 ///
>                                          18 "Others"

. 
.         label val industry indlab

.                                          
.                                          
.         // generate 1910 baseline characteristics
.         qui foreach var in urban skill industry farm  classwkr lit marst yrsusa2 statefip empstat famsize wksunemp school labforce fips {

. 
.         // define baseline categories for 1910 variables interacted with 1920 dummy
.         replace urban1910    = 0 if urban1910==1         // rural
(2,497,871 real changes made)

.         replace skill1910    = 0 if skill1910==11        // non-occ response
(599,901 real changes made)

.         replace farm1910     = 0 if farm1910==1          // non-farm
(2,497,226 real changes made)

.         replace empstat1910  = 0 if empstat1910==30      // not in labor force
(0 real changes made)

.         replace lit1910          = 0 if lit1910==1               // illiterate
(86,809 real changes made)

.         replace marst1910        = 0 if marst1910==6     // single
(1,575,595 real changes made)

.         replace yrsusa21910  = 0 if yrsusa21910==5       // 21+ yrs
(0 real changes made)

.         replace statefip1910 = 0 if statefip1910==48 // Texas
(157,118 real changes made)

.         replace fips1910         = 0 if fips1910==42003  // Allegheny county, Pennsylvania
(35,387 real changes made)

.         replace school1910       = 0 if school1910==1    // not in school
(3,858,523 real changes made)

.         replace labforce1910 = 0 if labforce1910==1      // not in labor force
(0 real changes made)

. 
.         label val industry1910 indlab

.         label val skill1910 skillab

. 
. 
.         gen nonat = citizen==3 | citizen==4

.         gen noeng = speakeng==1

.         gen low = skill==10 | skill==9 | skill==8

. 
.         egen agri10 = max(industry1910==1), by(id)

.         gen farmer = industry==1 & year==1920 & agri10==0

. 
.         gen down = 0 if year==1920
(4,090,063 missing values generated)

.         replace down = 1 if skill1910==1 & skill>1 & year==1920
(72,606 real changes made)

.         replace down = 1 if (skill1910==3 | skill1910==4) & (skill>4 | skill==2) & year==1920
(230,136 real changes made)

.         replace down = 1 if (skill1910==5 | skill1910==6 | skill1910==7) & (skill>7 | skill==2) & year==1920
(377,677 real changes made)

.         replace down = 0 if down==. & year==1910
(4,090,063 real changes made)

. 
.         gen south = statename=="Alabama"        | statename=="Arkansas"                 | statename=="Delaware"                 | statename=="Florida"          | ///
>                                 statename=="Georgia"    | statename=="Kentucky"                 | statename=="Louisiana"                | statename=="Mississippi"      | ///
>                                 statename=="Missouri"   | statename=="North Carolina"   | statename=="South Carolina"   | statename=="Tennessee"        | ///
>                                 statename=="Texas"              | statename=="Virginia"

. 
.         gen south1920 = south*(year==1920)

.                                 
.         gen neweng = statename=="Maine"         | statename=="Connecticut"              | statename=="New Hampshire"    | statename=="Rhode Island" | ///
>                                  statename=="Vermont"   | statename=="Massachusetts"

. 
.         gen neweng1920 = neweng*(year==1920)

. 
.         gen midwest = statename=="Ohio" | statename=="Indiana" | statename=="Michigan" | statename=="Illinois" | statename=="Wisconsin" | statename=="Missouri" | statename=="Iowa" | statename=="Minnesota" | statename==
> "North Dakota" | statename=="South Dakota" | statename=="Nebraska" | statename=="Kansas"

.         gen notmidwest = midwest==0

.         gen notmidwest20 = notmidwest==1 & year==1920

. 
.         * industry dummies in 1910 for agriculture, manufacturing, retail
.         egen maxagri = max(industry1910==1), by(id)

.         egen maxmfg = max(industry1910==4 | industry1910==5), by(id)

.         egen maxret = max(industry1910==10), by(id)

. 
. 
. 
.         qui tab yrsusa2, gen(Dyrsusa2)

.         *gen school = school==2
.         gen atwork = empstat==1

.         gen lfyes = labforce==2

.         gen literate = lit==4

.         gen married = marst==1

.         gen farmst = farm==2

.         gen speaks = speakeng==2

.         gen mfg = industry==4 | industry==5

.         gen owns = ownershp==1

.         gen readwrite = lit==4

.         gen urbst = urban==2

.         gen employer = classwkr==2

.         gen naturalized = citizen==2 | citizen==4

. 
.         * generate sample dummy
. 
.         merge m:1 fips using "$path/Replication/cleaned_data/outflow_from_cnty_cens.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                     2,968,743
        from master                 2,968,743  (_merge==1)
        from using                          0  (_merge==2)

    Matched                         5,209,103  (_merge==3)
    -----------------------------------------

.         keep if _merge==3
(2,968,743 observations deleted)

.         drop _merge

. 
.         merge m:1 statefip sex age race occ1950 ind1950 using "$path/Replication/raw_data/lido_score_1950_public_use.dta"
(label statefip_lbl already defined)

    Result                      Number of obs
    -----------------------------------------
    Not matched                     5,816,808
        from master                   975,467  (_merge==1)
        from using                  4,841,341  (_merge==2)

    Matched                         4,233,636  (_merge==3)
    -----------------------------------------

.         drop if _merge==2
(4,841,341 observations deleted)

.         drop _merge

. 
.         gen lnoccscore = ln(occscore)
(667,795 missing values generated)

.         gen lnlido = ln(lido)
(975,467 missing values generated)

.         *keep if lnlido!=.
. 
.         replace outflow = 0 if year==1910
(1,048,489 real changes made)

.         *drop if skill1910==0
. 
. 
.         global controls "c.draftrate i.urban1910 i.skill1910 i.farm1910 i.empstat1910 i.lit1910 i.marst1910 c.famsize1910 i.school1910 i.labforce1910 c.wksunemp1910"

. 
. 
.         * works
.         *replace lnoccscore = 0 if lnoccscore==.
.         *replace lnlido = 0 if lnlido==.
. 
.         egen maxmover = max(mover), by(id)

.         keep if maxmover==0
(1,730,920 observations deleted)

. 
.         gen mgr = skill==1 | skill==3

.         gen op = skill==7

.         gen craft = skill==6

. 
.         keep if occ1950<=970 & ind1950<=970
(552,593 observations deleted)

. 
.         gen lnoccscore1 = ln(1+occscore)

.         gen lnlido1 = ln(1+lido)
(246,460 missing values generated)

. 
.         egen max2 = max(skill==2), by(id)

.         drop if max2==1
(1,576,865 observations deleted)

.                 
.         * keep those who have a full panel (2 periods)
.         bysort id: gen n = _n

.         egen maxn = max(n), by(id)

.         keep if maxn==2
(509,445 observations deleted)

.         drop n maxn

. 
.         drop if lnlido==.
(81,579 observations deleted)

. 
.         
.         compress
  variable age was int now byte
  variable county was float now int
  variable dead_acc was int now byte
  variable dead_kia was int now byte
  variable dead_wnd was int now byte
  variable statefips was float now byte
  variable state was int now byte
  variable tot_inducted_num was long now int
  variable tot_accepted_num was long now int
  variable treat was float now byte
  variable moved was float now byte
  variable mover was float now byte
  variable skill was float now byte
  variable industry was float now byte
  variable urban1910 was float now byte
  variable skill1910 was float now byte
  variable industry1910 was float now byte
  variable farm1910 was float now byte
  variable classwkr1910 was float now byte
  variable lit1910 was float now byte
  variable marst1910 was float now byte
  variable yrsusa21910 was float now byte
  variable statefip1910 was float now byte
  variable empstat1910 was float now byte
  variable famsize1910 was float now byte
  variable wksunemp1910 was float now byte
  variable school1910 was float now byte
  variable labforce1910 was float now byte
  variable nonat was float now byte
  variable noeng was float now byte
  variable low was float now byte
  variable agri10 was float now byte
  variable farmer was float now byte
  variable down was float now byte
  variable south was float now byte
  variable south1920 was float now byte
  variable neweng was float now byte
  variable neweng1920 was float now byte
  variable midwest was float now byte
  variable notmidwest was float now byte
  variable notmidwest20 was float now byte
  variable maxagri was float now byte
  variable maxmfg was float now byte
  variable maxret was float now byte
  variable atwork was float now byte
  variable lfyes was float now byte
  variable literate was float now byte
  variable married was float now byte
  variable farmst was float now byte
  variable speaks was float now byte
  variable mfg was float now byte
  variable owns was float now byte
  variable readwrite was float now byte
  variable urbst was float now byte
  variable employer was float now byte
  variable naturalized was float now byte
  variable maxmover was float now byte
  variable mgr was float now byte
  variable op was float now byte
  variable craft was float now byte
  variable max2 was float now byte
  variable fips was double now long
  variable nhgisnam was str36 now str19
  variable icpsrnam was str22 now str17
  variable statenam was str20 now str14
  (153,055,602 bytes saved)

.         save "$path/Replication/cleaned_data/linked_Americans_estimation_sample.dta", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/cleaned_data/linked_Americans_estimation_sample.dta saved

.         clear

. 
end of do-file

. 
. 
. *******************************************************************************************************************************************
. // Figures
. *******************************************************************************************************************************************
.         do "$path/Replication/2 - Generate figures.do"

. clear all

. capture set more off

. 
. /*
> * automatically set working directory
> foreach i in "Z:/Dropbox/projects/WWI German Discrimination"                            ///
>                          "D:/Dropbox/projects/WWI German Discrimination"                                ///
>                          "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"   ///
>                          "your directiory" {
> 
>                          global path "`i'"
>                          confirmdir "$path"
>                          if `r(confirmdir)'==0 continue, break
> }
> */
. 
. 
. *******************************************************************************************************************************************
. * FIGURE 1 
. *******************************************************************************************************************************************
. 
. * This is a scan of two newspaper articles; no replication for this
. 
. 
. 
. *******************************************************************************************************************************************
. * FIGURE 2 
. *******************************************************************************************************************************************
. 
. use "$path/county_panel_longrun.dta"

. 
. preserve

.         ren county countyA

.         gen county = fipsRC

. 
.         * Figure 3A
.         ren (Dgermans id) (DgermansA id1)

.         xtset fipsRC year, delta(10)

Panel variable: fipsRC (unbalanced)
 Time variable: year, 1870 to 1940, but with gaps
         Delta: 10 units

.         
.         gen Dgermans = D.germanshare
(3,219 missing values generated)

.         replace Dgermans = 0 if Dgermans==. & year==1920
(124 real changes made)

.         
.         * maps with adjustment for pre-war German pop (PANEL A)
.         qui reg Dgermans ger1910 

.         predict Dgermans2, res
(3,095 missing values generated)

.         
.         maptile Dgermans2 if year==1920, geo(county1910) n(5) twopt(plotregion(margin(vlarge)) legend(position(4) bmargin(zero))) revcolor

.         graph export "$path/Replication/figures/Germanshare_change_popadj.pdf", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/Germanshare_change_popadj.pdf saved as PDF format

.         gr close

.         
.         * PANEL B
.         qui reg casrate_1845amm ger1910

.         predict casrate_1845amm2, res
(1,033 missing values generated)

.         
.         maptile casrate_1845amm2 if year==1920, geo(county1910) n(5) twopt(plotregion(margin(vlarge)) legend(position(4) bmargin(zero)))

.         graph export "$path/Replication/figures/WWI_casualties_popadj.pdf", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/WWI_casualties_popadj.pdf saved as PDF format

.         gr close

. restore

.         
. 
. *******************************************************************************************************************************************
. * FIGURE 3 
. *******************************************************************************************************************************************
. 
.         * Panel a) relationship between WWI casualties and change German pop in 1920
.         qui reg Dgermanshareres casrate i.state if year==1920

.         local b = round(_b[casrate], 0.001)

.         local r2 = round(e(r2), 0.001)

. 
.         binscatter Dgermanshareres casrate if year==1920, xtitle("WWI Casualty Rate") ytitle("Change % German Pop. 1910-20") text(0.18 0.625 "beta = `b'") text(0.14 0.63 "R2 = `r2'") control(i.state) yline(0, lc(gs8)) 
> ylab(-0.2(0.1)0.2, gmax gmin) xlab(0(0.1)0.8) graphr(c(white) margin(medsmall)) 

.         gr export "$path/Replication/figures/firststage_binscatter_1910-20.pdf", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/firststage_binscatter_1910-20.pdf saved as PDF format

.         gr close

.         
.         * Panel b) relationship between WWI casualties and change German pop in 1910
.         qui reg Dgermanshareres casrate i.state if year==1910

.         local b = round(_b[casrate], 0.001)

.         local r2 = round(e(r2), 0.001)

. 
.         binscatter Dgermanshareres casrate if year==1910, xtitle("WWI Casualty Rate") ytitle("Change % German Pop. 1900-10") text(0.18 0.625 "beta = `b'") text(0.14 0.63 "R2 = `r2'") control(i.state) yline(0, lc(gs8)) 
> ylab(-0.2(0.1)0.2, gmax gmin) xlab(0(0.1)0.8) graphr(c(white) margin(medsmall)) 

.         gr export "$path/Replication/figures/firststage_binscatter_1900-10.pdf", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/firststage_binscatter_1900-10.pdf saved as PDF format

.         gr close

.         
.         * Panel c) relationship between WWI casualties and change Swedish pop in 1920
.         qui reg Dswedeshareres casrate i.state swe1910 if year==1920

.         local b = round(_b[casrate], 0.001)

.         local j = round(e(r2), 0.001)

.         local r2 : display %4.3f `j'

. 
.         binscatter Dswedeshareres casrate if year==1920, xtitle("WWI Casualty Rate") ytitle("Change % Swedish Pop. 1910-20") text(0.18 0.625 "beta = `b'") text(0.14 0.63 "R2 = `r2'") control(i.state swe1910) yline(0, l
> c(gs8)) ylab(-0.2(0.1)0.2, gmax gmin) xlab(0(0.1)0.8) graphr(c(white) margin(medsmall)) 

.         gr export "$path/Replication/figures/firststage_binscatter_swedes.pdf", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/firststage_binscatter_swedes.pdf saved as PDF format

.         gr close

. 
.         * Panel d) relationship between WWI casualties and change Swedish pop in 1920
.         qui reg Ditalianshareres casrate i.state ita1910 if year==1920

.         local b = round(_b[casrate], 0.001)

.         local r2 = round(e(r2), 0.001)

. 
.         binscatter Ditalianshareres casrate if year==1920, xtitle("WWI Casualty Rate") ytitle("Change % Italian Pop. 1910-20") text(0.18 0.625 "beta = `b'") text(0.14 0.63 "R2 = `r2'") control(i.state ita1910) yline(0,
>  lc(gs8)) ylab(-0.2(0.1)0.2, gmax gmin) xlab(0(0.1)0.8) graphr(c(white) margin(medsmall)) 

.         gr export "$path/Replication/figures/firststage_binscatter_italians.pdf", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/firststage_binscatter_italians.pdf saved as PDF format

.         gr close

.         
.         
. 
. *******************************************************************************************************************************************
. * FIGURE 4
. *******************************************************************************************************************************************
. 
. global eventcontrols "c.prewarGer c.draftrate_amm1845#i.year c.prewarPOP#i.year c.prewarMFGL#i.year c.prewarMF#i.year c.prewarurb#i.year"

. 
. reghdfe germanshare 1.quincas#i.year 2.quincas#i.year 4.quincas#i.year 5.quincas#i.year $eventcontrols if year>1870, a(id i.year i.year#c.state) cluster(id)
(dropped 597 singleton observations)
(MWFE estimator converged in 7 iterations)
note: 1940.year#c.draftrate_amm1845 omitted because of collinearity
note: 1910.year#c.prewarPOP omitted because of collinearity
note: 1910.year#c.prewarMFGL omitted because of collinearity
note: 1910.year#c.prewarMF omitted because of collinearity
note: 1910.year#c.prewarurb omitted because of collinearity

HDFE Linear regression                            Number of obs   =     15,952
Absorbing 3 HDFE groups                           F(  55,   2309) =       6.60
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.8041
                                                  Adj R-squared   =     0.7697
                                                  Within R-sq.    =     0.0733
Number of clusters (id)      =      2,310         Root MSE        =     1.3380

                                             (Std. err. adjusted for 2,310 clusters in id)
------------------------------------------------------------------------------------------
                         |               Robust
             germanshare | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------------------+----------------------------------------------------------------
            quincas#year |
                 1 1880  |  -.0811516   .1316393    -0.62   0.538    -.3392952     .176992
                 1 1890  |  -.1734437   .0982867    -1.76   0.078    -.3661831    .0192958
                 1 1900  |  -.0819069    .047892    -1.71   0.087    -.1758227    .0120088
                 1 1910  |          0  (empty)
                 1 1920  |   .2031405   .0446728     4.55   0.000     .1155376    .2907435
                 1 1930  |   .2939581    .066501     4.42   0.000     .1635502     .424366
                 1 1940  |   .3928601   .0868337     4.52   0.000     .2225799    .5631404
                 2 1880  |    .008207   .1400279     0.06   0.953    -.2663867    .2828007
                 2 1890  |   .0165889   .1109448     0.15   0.881    -.2009729    .2341508
                 2 1900  |   .0133769   .0553829     0.24   0.809    -.0952285    .1219822
                 2 1910  |          0  (empty)
                 2 1920  |   .0399042   .0516331     0.77   0.440    -.0613478    .1411562
                 2 1930  |   .0592664   .0760778     0.78   0.436    -.0899215    .2084543
                 2 1940  |   .0951883   .0993249     0.96   0.338    -.0995871    .2899637
                 4 1880  |   .0299861   .1532812     0.20   0.845     -.270597    .3305693
                 4 1890  |   .0761967   .1237829     0.62   0.538    -.1665405    .3189339
                 4 1900  |  -.0111221   .0602613    -0.18   0.854     -.129294    .1070498
                 4 1910  |          0  (empty)
                 4 1920  |  -.0930436   .0604441    -1.54   0.124     -.211574    .0254869
                 4 1930  |  -.1073908   .0866722    -1.24   0.215    -.2773543    .0625727
                 4 1940  |  -.1165013   .1121901    -1.04   0.299    -.3365052    .1035026
                 5 1880  |  -.1040439   .1706248    -0.61   0.542    -.4386377    .2305499
                 5 1890  |   .0335565   .1316672     0.25   0.799    -.2246417    .2917547
                 5 1900  |  -.0276631   .0621387    -0.45   0.656    -.1495166    .0941904
                 5 1910  |          0  (empty)
                 5 1920  |  -.2391193   .0659744    -3.62   0.000    -.3684946    -.109744
                 5 1930  |  -.2882816   .0938242    -3.07   0.002      -.47227   -.1042931
                 5 1940  |  -.3744757   .1223338    -3.06   0.002    -.6143712   -.1345801
                         |
               prewarGer |   -.016384   .0091147    -1.80   0.072    -.0342578    .0014899
                         |
year#c.draftrate_amm1845 |
                   1880  |   .0817228   .0204856     3.99   0.000     .0415506    .1218949
                   1890  |   .0941943    .020056     4.70   0.000     .0548647    .1335239
                   1900  |   .0688893   .0149285     4.61   0.000     .0396145     .098164
                   1910  |   .0471327   .0103599     4.55   0.000     .0268171    .0674483
                   1920  |   .0198982   .0048219     4.13   0.000     .0104424    .0293539
                   1930  |   .0094236   .0023415     4.02   0.000     .0048318    .0140153
                   1940  |          0  (omitted)
                         |
        year#c.prewarPOP |
                   1880  |   2.39e-06   4.93e-06     0.48   0.628    -7.28e-06    .0000121
                   1890  |   2.33e-06   3.61e-06     0.64   0.519    -4.76e-06    9.42e-06
                   1900  |  -9.19e-08   1.83e-06    -0.05   0.960    -3.68e-06    3.49e-06
                   1910  |          0  (omitted)
                   1920  |   3.36e-06   1.91e-06     1.76   0.079    -3.85e-07    7.11e-06
                   1930  |   4.97e-06   2.67e-06     1.86   0.063    -2.71e-07    .0000102
                   1940  |   7.36e-06   3.38e-06     2.18   0.030     7.29e-07     .000014
                         |
       year#c.prewarMFGL |
                   1880  |   .4513094   1.828766     0.25   0.805    -3.134886    4.037504
                   1890  |  -.6123909    1.47356    -0.42   0.678     -3.50203    2.277249
                   1900  |  -.5091251   .8077003    -0.63   0.529    -2.093019    1.074769
                   1910  |          0  (omitted)
                   1920  |   -2.15849   .9646629    -2.24   0.025    -4.050186   -.2667935
                   1930  |  -1.975757   1.290693    -1.53   0.126    -4.506796     .555282
                   1940  |  -2.089204   1.643814    -1.27   0.204    -5.312711    1.134303
                         |
         year#c.prewarMF |
                   1880  |   .4297072   .1694224     2.54   0.011     .0974712    .7619432
                   1890  |   .3465004   .1167243     2.97   0.003     .1176051    .5753957
                   1900  |   .1726659   .0649892     2.66   0.008     .0452226    .3001092
                   1910  |          0  (omitted)
                   1920  |   -.269578    .075058    -3.59   0.000    -.4167662   -.1223898
                   1930  |  -.3522228   .1048511    -3.36   0.001     -.557835   -.1466106
                   1940  |    -.47869   .1407573    -3.40   0.001    -.7547139   -.2026662
                         |
        year#c.prewarurb |
                   1880  |   .0413026   .0104956     3.94   0.000     .0207208    .0618843
                   1890  |   .0410118   .0085036     4.82   0.000     .0243363    .0576873
                   1900  |   .0199525   .0040992     4.87   0.000      .011914    .0279909
                   1910  |          0  (omitted)
                   1920  |  -.0198321    .003808    -5.21   0.000    -.0272995   -.0123647
                   1930  |  -.0282278   .0055738    -5.06   0.000     -.039158   -.0172975
                   1940  |  -.0348782   .0070059    -4.98   0.000    -.0486167   -.0211396
                         |
                   _cons |   1.156391   .1320091     8.76   0.000     .8975227     1.41526
------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
------------------------------------------------------+
  Absorbed FE | Categories  - Redundant  = Num. Coefs |
--------------+---------------------------------------|
           id |      2310        2310           0    *|
         year |         7           0           7     |
 year#c.state |         7           0           7    ?|
------------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

. 
. 
. foreach i in 1 5 {
  2.         
.         #delimit ;
delimiter now ;
.         coefplot, keep(`i'.quincas*) vertical base omitted
>                           graphr(c(white) margin(medsmall)) 
>                           mcolor(gs4) yline(0, lcolor(black))
>                           ciopts(recast(rcap) lcolor(gs4))
>                           rename(`i'.quincas#1880.year = 1880
>                                          `i'.quincas#1890.year = 1890
>                                          `i'.quincas#1900.year = 1900
>                                          `i'.quincas#1910.year = 1910
>                                          `i'.quincas#1920.year = 1920
>                                          `i'.quincas#1930.year = 1930
>                                          `i'.quincas#1940.year = 1940)
>                                          xline(4.7, lwidth(4) lc(gs14)) ylab(-0.75(0.25)0.75, gmin gmax);
  3.         #delimit cr
delimiter now cr
. 
.         gr export "$path/Replication/figures/quantile`i'_coefplot.pdf", replace
  4.         gr close
  5.         
. }
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/quantile1_coefplot.pdf saved as PDF format
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/quantile5_coefplot.pdf saved as PDF format

.         
.         
. 
. *******************************************************************************************************************************************
. * FIGURE 5
. *******************************************************************************************************************************************
. use "$path/county_panel_shortrun.dta", clear

. 
. global controls "c.prewarGer i.year draftrate_amm1845post c.prewarPOP#1.post c.prewarMFGL#1.post c.prewarMF#1.post c.prewarurb#1.post"

. 
. areg lnwages c.max_outflow#i.year $controls if year>1890 & S==1, a(id) cluster(id)
note: 1910.year#c.max_outflow omitted because of collinearity.

Linear regression, absorbing indicators           Number of obs     =   10,353
Absorbed variable: id                             No. of categories =    2,227
                                                  F(14, 2226)       = 93427.04
                                                  Prob > F          =   0.0000
                                                  R-squared         =   0.9035
                                                  Adj R-squared     =   0.8768
                                                  Root MSE          =   0.1758

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
   year#c.max_outflow |
                1900  |  -.0063929   .0074144    -0.86   0.389    -.0209328    .0081469
                1910  |          0  (omitted)
                1920  |  -.0470242   .0074268    -6.33   0.000    -.0615884     -.03246
                1930  |  -.0144868   .0077028    -1.88   0.060    -.0295922    .0006186
                1940  |    .002421   .0082221     0.29   0.768    -.0137027    .0185447
                      |
            prewarGer |   .0099047   .0017624     5.62   0.000     .0064485    .0133609
                      |
                 year |
                1910  |   .4229781   .0064327    65.75   0.000     .4103633    .4355928
                1920  |  -.7255564   .0254371   -28.52   0.000    -.7754392   -.6756736
                1930  |  -.3444072   .0257382   -13.38   0.000    -.3948806   -.2939337
                1940  |  -.2249311   .0261815    -8.59   0.000    -.2762738   -.1735884
                      |
draftrate_amm1845post |   .0004447   .0009984     0.45   0.656    -.0015132    .0024027
                      |
     post#c.prewarPOP |
                   1  |   1.74e-06   3.25e-07     5.35   0.000     1.10e-06    2.38e-06
                      |
    post#c.prewarMFGL |
                   1  |   .0020797   .0013112     1.59   0.113    -.0004915     .004651
                      |
      post#c.prewarMF |
                   1  |    -.03539   .0197378    -1.79   0.073    -.0740965    .0033164
                      |
     post#c.prewarurb |
                   1  |   -.000695   .0004556    -1.53   0.127    -.0015884    .0001985
                      |
                _cons |   1.484465   .0057269   259.21   0.000     1.473234    1.495696
---------------------------------------------------------------------------------------

. 
.         coefplot, keep(*max_outflow*) vertical base omitted     ///
>                           graphr(c(white) margin(medsmall))             ///
>                           mcolor(gs4) yline(0, lcolor(black))           ///
>                           ciopts(recast(rcap) lcolor(gs4))                      ///
>                           rename(1900.year#c.max_outflow = 1900         ///
>                                          1910.year#c.max_outflow = 1910         ///
>                                          1920.year#c.max_outflow = 1920         ///
>                                          1930.year#c.max_outflow = 1930         ///
>                                          1940.year#c.max_outflow = 1940)        ///
>                                          xline(2.7, lwidth(4) lc(gs14)) ylab(-0.06(0.02)0.04, gmin gmax)

. 
. gr export "$path/Replication/figures/dynamic_wage_effect.pdf", replace
file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/figures/dynamic_wage_effect.pdf saved as PDF format

. gr close

. 
end of do-file

. 
. 
. *******************************************************************************************************************************************
. // Tables
. *******************************************************************************************************************************************
.         do "$path/Replication/3 - Generate tables.do"

. clear all

. capture set more off

. 
. /*
> * automatically set working directory
> foreach i in "Z:/Dropbox/projects/WWI German Discrimination"                            ///
>                          "D:/Dropbox/projects/WWI German Discrimination"                                ///
>                          "C:/Users/anf137/Dropbox/projects/WWI German Discrimination"   ///
>                          "your directiory" {
> 
>                          global path "`i'"
>                          confirmdir "$path"
>                          if `r(confirmdir)'==0 continue, break
> }
> */
. 
. 
.         
.         
. *******************************************************************************************************************************************
. * TABLE 1
. *******************************************************************************************************************************************
. use "$path/Replication/cleaned_data/county_panel_shortrun.dta", clear

. 
.         global controls "c.prewarGer i.year draftrate_amm1845post c.prewarPOP#1.post c.prewarMFGL#1.post c.prewarMF#1.post c.prewarurb#1.post"

. 
.         
.         * Only counties w newspapers
. 
.         * Column 1
.         areg enemy_share_npcom_main casrate_1845amm $controls if mindist==1 & year==1920, a(state) robust
note: 1920.year omitted because of collinearity.

Linear regression, absorbing indicators             Number of obs     =    769
Absorbed variable: state                            No. of categories =     45
                                                    F(7, 717)         =   3.12
                                                    Prob > F          = 0.0030
                                                    R-squared         = 0.1712
                                                    Adj R-squared     = 0.1122
                                                    Root MSE          = 0.0901

---------------------------------------------------------------------------------------
                      |               Robust
enemy_share_npcom_m~n | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
      casrate_1845amm |   .0528527   .0304883     1.73   0.083    -.0070042    .1127096
            prewarGer |  -.0020554   .0010038    -2.05   0.041    -.0040261   -.0000847
                      |
                 year |
                1920  |          0  (omitted)
                      |
draftrate_amm1845post |  -.0003333   .0005304    -0.63   0.530    -.0013745     .000708
                      |
     post#c.prewarPOP |
                   1  |  -1.14e-07   3.58e-07    -0.32   0.750    -8.16e-07    5.88e-07
                      |
    post#c.prewarMFGL |
                   1  |   .0021803   .0017643     1.24   0.217    -.0012834    .0056441
                      |
      post#c.prewarMF |
                   1  |  -.0194454   .0120396    -1.62   0.107    -.0430824    .0041916
                      |
     post#c.prewarurb |
                   1  |   .0008136   .0004323     1.88   0.060     -.000035    .0016622
                      |
                _cons |    .382576   .0198432    19.28   0.000     .3436183    .4215337
---------------------------------------------------------------------------------------

.                 qui su enemy_share_npcom if year==1920

.                 estadd scalar ymean = r(mean)

added scalar:
              e(ymean) =  .37232736

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .11220259

.                 est store regN1

.                 cap drop N1

.                 gen N1 = e(sample)

. 
.         * Column 2
.         areg hun_share_npcom_main casrate_1845amm $controls if mindist==1 & year==1920, a(state) robust
note: 1920.year omitted because of collinearity.

Linear regression, absorbing indicators             Number of obs     =    769
Absorbed variable: state                            No. of categories =     45
                                                    F(7, 717)         =   4.77
                                                    Prob > F          = 0.0000
                                                    R-squared         = 0.1634
                                                    Adj R-squared     = 0.1039
                                                    Root MSE          = 0.0582

---------------------------------------------------------------------------------------
                      |               Robust
 hun_share_npcom_main | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
      casrate_1845amm |   .0343676   .0187341     1.83   0.067    -.0024127    .0711479
            prewarGer |  -.0023262   .0007001    -3.32   0.001    -.0037007   -.0009516
                      |
                 year |
                1920  |          0  (omitted)
                      |
draftrate_amm1845post |  -.0005391    .000447    -1.21   0.228    -.0014167    .0003386
                      |
     post#c.prewarPOP |
                   1  |   5.18e-07   2.20e-07     2.35   0.019     8.59e-08    9.50e-07
                      |
    post#c.prewarMFGL |
                   1  |    .000347   .0012072     0.29   0.774    -.0020232    .0027171
                      |
      post#c.prewarMF |
                   1  |   .0130459   .0122333     1.07   0.287    -.0109715    .0370634
                      |
     post#c.prewarurb |
                   1  |   .0004643   .0003145     1.48   0.140    -.0001531    .0010817
                      |
                _cons |   .1660976   .0166714     9.96   0.000      .133367    .1988282
---------------------------------------------------------------------------------------

.                 qui su hun_share_npcom if year==1920

.                 estadd scalar ymean = r(mean)

added scalar:
              e(ymean) =  .19088744

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .10386922

.                 est store regN2

.                 cap drop N2

.                 gen N2 = e(sample)

. 
.         * Column 3
.         areg tar_share_npcom_main casrate_1845amm $controls if mindist==1 & year==1920, a(state) robust
note: 1920.year omitted because of collinearity.

Linear regression, absorbing indicators             Number of obs     =    769
Absorbed variable: state                            No. of categories =     45
                                                    F(7, 717)         =   6.58
                                                    Prob > F          = 0.0000
                                                    R-squared         = 0.1464
                                                    Adj R-squared     = 0.0856
                                                    Root MSE          = 0.0030

---------------------------------------------------------------------------------------
                      |               Robust
 tar_share_npcom_main | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
      casrate_1845amm |   .0019605   .0008989     2.18   0.030     .0001957    .0037253
            prewarGer |   .0000567   .0000607     0.93   0.350    -.0000625    .0001759
                      |
                 year |
                1920  |          0  (omitted)
                      |
draftrate_amm1845post |  -.0000384   .0000172    -2.23   0.026    -.0000722   -4.57e-06
                      |
     post#c.prewarPOP |
                   1  |   1.63e-08   1.15e-08     1.42   0.157    -6.31e-09    3.90e-08
                      |
    post#c.prewarMFGL |
                   1  |  -.0001211   .0000527    -2.30   0.022    -.0002246   -.0000176
                      |
      post#c.prewarMF |
                   1  |    -.00058    .000253    -2.29   0.022    -.0010767   -.0000833
                      |
     post#c.prewarurb |
                   1  |   .0000581   .0000165     3.51   0.000     .0000256    .0000905
                      |
                _cons |   .0036645   .0004849     7.56   0.000     .0027124    .0046166
---------------------------------------------------------------------------------------

.                 qui su tar_share_npcom if year==1920

.                 estadd scalar ymean = r(mean)

added scalar:
              e(ymean) =  .003324

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .08563254

.                 est store regN3

.                 cap drop N3

.                 gen N3 = e(sample)

. 
.                 
.         * with neighboring counties
. 
.         * Column 4
.         areg enemy_share_npcom casrate_1845amm $controls if (newspaper_neighbor==1 | mindist==1) & year==1920 [aw=weight], a(state) robust
(sum of wgt is 788.0534675163217)
note: 1920.year omitted because of collinearity.

Linear regression, absorbing indicators             Number of obs     =  1,469
Absorbed variable: state                            No. of categories =     47
                                                    F(7, 1415)        =   3.16
                                                    Prob > F          = 0.0025
                                                    R-squared         = 0.1683
                                                    Adj R-squared     = 0.1371
                                                    Root MSE          = 0.0889

---------------------------------------------------------------------------------------
                      |               Robust
    enemy_share_npcom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
      casrate_1845amm |   .0493803   .0286842     1.72   0.085    -.0068878    .1056484
            prewarGer |  -.0020815   .0009635    -2.16   0.031    -.0039716   -.0001913
                      |
                 year |
                1920  |          0  (omitted)
                      |
draftrate_amm1845post |    -.00018   .0004838    -0.37   0.710    -.0011291    .0007691
                      |
     post#c.prewarPOP |
                   1  |  -1.24e-07   3.41e-07    -0.36   0.716    -7.93e-07    5.45e-07
                      |
    post#c.prewarMFGL |
                   1  |    .002159    .001681     1.28   0.199    -.0011386    .0054565
                      |
      post#c.prewarMF |
                   1  |  -.0200486   .0116887    -1.72   0.087    -.0429777    .0028804
                      |
     post#c.prewarurb |
                   1  |   .0008117   .0004181     1.94   0.052    -8.44e-06    .0016318
                      |
                _cons |    .382774   .0190124    20.13   0.000     .3454784    .4200696
---------------------------------------------------------------------------------------

.                 qui su enemy_share_npcom if year==1920

.                 estadd scalar ymean = r(mean)

added scalar:
              e(ymean) =  .37232736

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .13713609

.                 est store regN4

. 
.         * Column 5
.         areg hun_share_npcom casrate_1845amm $controls if (newspaper_neighbor==1 | mindist==1) & year==1920 [aw=weight], a(state) robust
(sum of wgt is 788.0534675163217)
note: 1920.year omitted because of collinearity.

Linear regression, absorbing indicators             Number of obs     =  1,469
Absorbed variable: state                            No. of categories =     47
                                                    F(7, 1415)        =   4.86
                                                    Prob > F          = 0.0000
                                                    R-squared         = 0.1583
                                                    Adj R-squared     = 0.1267
                                                    Root MSE          = 0.0576

---------------------------------------------------------------------------------------
                      |               Robust
      hun_share_npcom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
      casrate_1845amm |   .0310602   .0177525     1.75   0.080    -.0037639    .0658844
            prewarGer |  -.0023322   .0006712    -3.47   0.001    -.0036488   -.0010155
                      |
                 year |
                1920  |          0  (omitted)
                      |
draftrate_amm1845post |  -.0003931   .0004236    -0.93   0.354    -.0012242    .0004379
                      |
     post#c.prewarPOP |
                   1  |   4.99e-07   2.12e-07     2.36   0.019     8.38e-08    9.15e-07
                      |
    post#c.prewarMFGL |
                   1  |   .0002388   .0011543     0.21   0.836    -.0020255    .0025031
                      |
      post#c.prewarMF |
                   1  |   .0125547   .0118764     1.06   0.291    -.0107427     .035852
                      |
     post#c.prewarurb |
                   1  |   .0004713   .0003045     1.55   0.122    -.0001259    .0010686
                      |
                _cons |   .1667161   .0160873    10.36   0.000     .1351587    .1982736
---------------------------------------------------------------------------------------

.                 qui su hun_share_npcom if year==1920

.                 estadd scalar ymean = r(mean)

added scalar:
              e(ymean) =  .19088744

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .12672249

.                 est store regN5

. 
.         * Column 6
.         areg tar_share_npcom casrate_1845amm $controls if (newspaper_neighbor==1 | mindist==1) & year==1920 [aw=weight], a(state) robust
(sum of wgt is 788.0534675163217)
note: 1920.year omitted because of collinearity.

Linear regression, absorbing indicators             Number of obs     =  1,469
Absorbed variable: state                            No. of categories =     47
                                                    F(7, 1415)        =   6.81
                                                    Prob > F          = 0.0000
                                                    R-squared         = 0.1434
                                                    Adj R-squared     = 0.1113
                                                    Root MSE          = 0.0030

---------------------------------------------------------------------------------------
                      |               Robust
      tar_share_npcom | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
      casrate_1845amm |   .0018202   .0008443     2.16   0.031      .000164    .0034764
            prewarGer |   .0000552   .0000582     0.95   0.343     -.000059    .0001694
                      |
                 year |
                1920  |          0  (omitted)
                      |
draftrate_amm1845post |  -.0000317   .0000154    -2.06   0.040    -.0000619   -1.46e-06
                      |
     post#c.prewarPOP |
                   1  |   1.51e-08   1.09e-08     1.38   0.167    -6.33e-09    3.66e-08
                      |
    post#c.prewarMFGL |
                   1  |  -.0001179   .0000501    -2.35   0.019     -.000216   -.0000197
                      |
      post#c.prewarMF |
                   1  |  -.0005956   .0002434    -2.45   0.015     -.001073   -.0001182
                      |
     post#c.prewarurb |
                   1  |   .0000578    .000016     3.62   0.000     .0000265    .0000891
                      |
                _cons |   .0036644   .0004599     7.97   0.000     .0027622    .0045665
---------------------------------------------------------------------------------------

.                 qui su tar_share_npcom if year==1920

.                 estadd scalar ymean = r(mean)

added scalar:
              e(ymean) =  .003324

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .11130521

.                 est store regN6

.         
.         * store table as tex file
.         #delimit ;
delimiter now ;
.         esttab regN* using "$path/Replication/tables/table1.tex",
>                    replace star(* 0.10 ** 0.05 *** 0.01)
>                    keep(casrate_1845amm)
>                    coeflabels(casrate_1845amm "WWI Casualty Rate")
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")
>                    stats(ymean N R2, fmt(%9.3fc %9.0fc %9.3fc)
>                    label("\\[-1em] \hline Outcome mean"
>                                  "Observations"
>                                  "Adj.\ R$^2$"));
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table1.tex)

.         #delimit cr
delimiter now cr
.         est clear

. 
.         
.         
. *******************************************************************************************************************************************
. * TABLE 2
. *******************************************************************************************************************************************
. use "$path/Replication/cleaned_data/linked_Germans_estimation_sample.dta", clear

. 
.         global controls "c.draftrate i.urban1910 i.skill1910 i.farm1910 i.empstat1910 i.lit1910 i.marst1910 i.yrsusa21910 c.famsize1910 i.school1910 i.labforce1910 c.wksunemp1910"

.         
.         reghdfe mover treat $controls i.year if abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(dropped 58 singleton observations)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    583,534
Absorbing 3 HDFE groups                           F(  28,   2390) =     171.99
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.4971
                                                  Adj R-squared   =     0.4952
                                                  Within R-sq.    =     0.0888
Number of clusters (fips)    =      2,391         Root MSE        =     0.3081

                                                    (Std. err. adjusted for 2,391 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                            mover | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |    .567203   .2129332     2.66   0.008     .1496501     .984756
                        draftrate |          0  (omitted)
                      2.urban1910 |   -.020893    .004285    -4.88   0.000    -.0292956   -.0124904
                                  |
                        skill1910 |
         Professional, Technical  |    .079073   .0115451     6.85   0.000     .0564336    .1017125
                         Farmers  |  -.0068012   .0107641    -0.63   0.528    -.0279092    .0143068
Managers, Officials, Proprietors  |   .0055775   .0061066     0.91   0.361    -.0063972    .0175522
            Clerical and Kindred  |  -.0078789    .006598    -1.19   0.233    -.0208174    .0050596
                   Sales workers  |   .0114034   .0072992     1.56   0.118      -.00291    .0257167
                       Craftsmen  |   .0106581   .0061992     1.72   0.086    -.0014982    .0228144
                      Operatives  |   .0416675   .0087912     4.74   0.000     .0244284    .0589066
   Service Workers (priv househ)  |   .0246306   .0072278     3.41   0.001     .0104573    .0388039
                   Farm Laborers  |    .053348   .0064043     8.33   0.000     .0407896    .0659065
                        Laborers  |   .0965953   .0075089    12.86   0.000     .0818707    .1113199
                                  |
                       2.farm1910 |  -.0382615   .0045013    -8.50   0.000    -.0470884   -.0294347
                                  |
                      empstat1910 |
                               1  |  -.0231077   .0047724    -4.84   0.000    -.0324662   -.0137493
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |  -.0229111   .0091077    -2.52   0.012    -.0407709   -.0050513
                               4  |  -.0550486   .0070547    -7.80   0.000    -.0688826   -.0412147
                                  |
                        marst1910 |
                               1  |  -.1010341   .0045978   -21.97   0.000    -.1100501   -.0920181
                               2  |   .0419971   .0053513     7.85   0.000     .0315035    .0524907
                               4  |   .0030131   .0146054     0.21   0.837    -.0256275    .0316537
                               5  |   -.039192   .0052246    -7.50   0.000    -.0494373   -.0289468
                                  |
                      yrsusa21910 |
                               1  |   .1882222   .0155114    12.13   0.000     .1578051    .2186394
                               2  |   .1414062   .0121898    11.60   0.000     .1175024      .16531
                               3  |   .0884601   .0066601    13.28   0.000     .0753999    .1015203
                               4  |   .0404512   .0029801    13.57   0.000     .0346074     .046295
                                  |
                      famsize1910 |  -.0130609   .0004594   -28.43   0.000    -.0139618   -.0121599
                     2.school1910 |  -.0327898   .0055201    -5.94   0.000    -.0436145    -.021965
                   2.labforce1910 |   .0203544   .0044852     4.54   0.000     .0115591    .0291496
                     wksunemp1910 |   -.000125   .0000257    -4.86   0.000    -.0001755   -.0000746
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |    .208935   .0414801     5.04   0.000     .1275943    .2902758
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2098           0        2098     |
     birthyr |        94           1          93     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 qui su mover if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .25110962

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .49516583

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2391

.                 est store regA1

.                 
.         reghdfe dist treat $controls missdist i.year if maxmover==1 & abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    293,062
Absorbing 3 HDFE groups                           F(  29,   2345) =      35.47
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.4553
                                                  Adj R-squared   =     0.4513
                                                  Within R-sq.    =     0.1646
Number of clusters (fips)    =      2,346         Root MSE        =   340.0727

                                                    (Std. err. adjusted for 2,346 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                             dist | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   457.6688   37.43329    12.23   0.000      384.263    531.0746
                        draftrate |          0  (omitted)
                      2.urban1910 |   19.93053   7.201685     2.77   0.006     5.808193    34.05286
                                  |
                        skill1910 |
         Professional, Technical  |  -30.69106   13.38567    -2.29   0.022    -56.94005   -4.442078
                         Farmers  |  -21.68077   11.43661    -1.90   0.058    -44.10769    .7461419
Managers, Officials, Proprietors  |  -5.748555   8.012122    -0.72   0.473    -21.46014    9.963025
            Clerical and Kindred  |   -4.86023   12.94553    -0.38   0.707    -30.24611    20.52565
                   Sales workers  |   8.466093   10.99578     0.77   0.441    -13.09636    30.02855
                       Craftsmen  |  -2.104703   8.019956    -0.26   0.793    -17.83165    13.62224
                      Operatives  |  -2.389296   9.004677    -0.27   0.791    -20.04725    15.26866
   Service Workers (priv househ)  |    8.21077   10.76192     0.76   0.446    -12.89309    29.31463
                   Farm Laborers  |   1.810104   11.91786     0.15   0.879    -21.56054    25.18075
                        Laborers  |   12.41274   11.17599     1.11   0.267    -9.503123    34.32859
                                  |
                       2.farm1910 |  -24.33155   7.087999    -3.43   0.001    -38.23094   -10.43215
                                  |
                      empstat1910 |
                               1  |   .9586396   6.988125     0.14   0.891    -12.74491    14.66219
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |   20.12026   15.42236     1.30   0.192    -10.12262    50.36314
                               4  |   11.08016   6.757664     1.64   0.101    -2.171457    24.33178
                                  |
                        marst1910 |
                               1  |  -36.12901   7.170922    -5.04   0.000    -50.19101     -22.067
                               2  |  -12.76693   7.363474    -1.73   0.083    -27.20653    1.672667
                               4  |  -7.487164   23.38552    -0.32   0.749     -53.3456    38.37128
                               5  |  -18.06187   8.231407    -2.19   0.028    -34.20347    -1.92028
                                  |
                      yrsusa21910 |
                               1  |  -10.11345    6.22456    -1.62   0.104    -22.31966    2.092767
                               2  |  -11.42146   6.715357    -1.70   0.089    -24.59011    1.747199
                               3  |  -9.029497   5.530106    -1.63   0.103     -19.8739    1.814908
                               4  |  -4.098797   3.883408    -1.06   0.291    -11.71407    3.516474
                                  |
                      famsize1910 |  -2.009943   .6785681    -2.96   0.003    -3.340599   -.6792876
                     2.school1910 |  -32.48922   12.10236    -2.68   0.007    -56.22165   -8.756787
                   2.labforce1910 |   6.587415   5.756687     1.14   0.253    -4.701311    17.87614
                     wksunemp1910 |   .1436962   .0476561     3.02   0.003     .0502437    .2371487
                         missdist |  -579.2529   37.28574   -15.54   0.000    -652.3693   -506.1364
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   208.2395   6.615096    31.48   0.000     195.2675    221.2116
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2014           0        2014     |
     birthyr |        93           1          92     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 qui su dist if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  219.67465

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .45132995

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2346

.                 est store regA2

.                 
.         reghdfe notmidwest20 treat $controls i.year if maxmover==1 & abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    293,062
Absorbing 3 HDFE groups                           F(  28,   2345) =      25.60
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.5464
                                                  Adj R-squared   =     0.5431
                                                  Within R-sq.    =     0.0453
Number of clusters (fips)    =      2,346         Root MSE        =     0.3131

                                                    (Std. err. adjusted for 2,346 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                     notmidwest20 | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   .5441523   .0586883     9.27   0.000     .4290659    .6592387
                        draftrate |          0  (omitted)
                      2.urban1910 |   .0159621   .0062761     2.54   0.011     .0036549    .0282693
                                  |
                        skill1910 |
         Professional, Technical  |  -.0341957   .0112321    -3.04   0.002    -.0562216   -.0121698
                         Farmers  |  -.0439234   .0094431    -4.65   0.000    -.0624411   -.0254057
Managers, Officials, Proprietors  |   .0018684   .0077068     0.24   0.808    -.0132444    .0169812
            Clerical and Kindred  |   -.006282   .0098518    -0.64   0.524    -.0256012    .0130371
                   Sales workers  |  -.0022342   .0123497    -0.18   0.856    -.0264516    .0219833
                       Craftsmen  |  -.0261702   .0068743    -3.81   0.000    -.0396505   -.0126898
                      Operatives  |  -.0163672   .0072015    -2.27   0.023    -.0304893   -.0022452
   Service Workers (priv househ)  |  -.0421444   .0102257    -4.12   0.000    -.0621967   -.0220921
                   Farm Laborers  |  -.0236138   .0097447    -2.42   0.015     -.042723   -.0045047
                        Laborers  |  -.0314793   .0092985    -3.39   0.001    -.0497134   -.0132452
                                  |
                       2.farm1910 |  -.0088102    .006604    -1.33   0.182    -.0217604      .00414
                                  |
                      empstat1910 |
                               1  |   .0187501   .0052959     3.54   0.000     .0083651    .0291352
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |   .0114828   .0148618     0.77   0.440    -.0176609    .0406265
                               4  |  -.0029441   .0074496    -0.40   0.693    -.0175526    .0116645
                                  |
                        marst1910 |
                               1  |  -.0037079    .006181    -0.60   0.549    -.0158287     .008413
                               2  |   .0168934   .0087879     1.92   0.055    -.0003394    .0341262
                               4  |  -.0016227   .0240558    -0.07   0.946    -.0487955    .0455501
                               5  |  -.0283274   .0106529    -2.66   0.008    -.0492175   -.0074372
                                  |
                      yrsusa21910 |
                               1  |   .0356297   .0125555     2.84   0.005     .0110086    .0602507
                               2  |   .0292158   .0103231     2.83   0.005     .0089724    .0494592
                               3  |   .0320317   .0091117     3.52   0.000     .0141638    .0498995
                               4  |   .0133962   .0049732     2.69   0.007     .0036438    .0231485
                                  |
                      famsize1910 |   .0016889   .0006044     2.79   0.005     .0005037    .0028741
                     2.school1910 |   .0113557   .0061302     1.85   0.064    -.0006655     .023377
                   2.labforce1910 |   .0226825   .0063912     3.55   0.000     .0101494    .0352155
                     wksunemp1910 |   .0000482   .0000335     1.44   0.150    -.0000175     .000114
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .1931459   .0157851    12.24   0.000     .1621917       .2241
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2014           0        2014     |
     birthyr |        93           1          92     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 qui su notmidwest20 if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .31174632

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .54305607

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2346

.                 est store regA3

.                 
.         reghdfe nonat treat $controls i.year if maxmover==1 & abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    293,062
Absorbing 3 HDFE groups                           F(  28,   2345) =      29.83
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.2295
                                                  Adj R-squared   =     0.2239
                                                  Within R-sq.    =     0.0296
Number of clusters (fips)    =      2,346         Root MSE        =     0.4218

                                                    (Std. err. adjusted for 2,346 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                            nonat | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   .2250901   .0145171    15.51   0.000     .1966224    .2535577
                        draftrate |          0  (omitted)
                      2.urban1910 |  -.0046511   .0039634    -1.17   0.241    -.0124232     .003121
                                  |
                        skill1910 |
         Professional, Technical  |  -.0391759   .0085497    -4.58   0.000    -.0559417   -.0224101
                         Farmers  |   .0332856   .0115966     2.87   0.004     .0105449    .0560263
Managers, Officials, Proprietors  |   -.022651   .0065411    -3.46   0.001    -.0354779   -.0098241
            Clerical and Kindred  |   .0166332   .0099092     1.68   0.093    -.0027985    .0360649
                   Sales workers  |  -.0084833   .0094941    -0.89   0.372     -.027101    .0101345
                       Craftsmen  |   .0102154   .0091981     1.11   0.267    -.0078218    .0282527
                      Operatives  |   .0242198   .0090164     2.69   0.007     .0065388    .0419008
   Service Workers (priv househ)  |   .0351261   .0145986     2.41   0.016     .0064986    .0637535
                   Farm Laborers  |   .0523361   .0103997     5.03   0.000     .0319426    .0727297
                        Laborers  |    .055384   .0077945     7.11   0.000     .0400991    .0706689
                                  |
                       2.farm1910 |   .0087727    .006152     1.43   0.154    -.0032912    .0208366
                                  |
                      empstat1910 |
                               1  |  -.0152526   .0059229    -2.58   0.010    -.0268673   -.0036379
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |  -.0128826   .0110968    -1.16   0.246    -.0346432     .008878
                               4  |  -.0601818   .0081189    -7.41   0.000    -.0761028   -.0442609
                                  |
                        marst1910 |
                               1  |  -.0752247   .0110188    -6.83   0.000    -.0968324    -.053617
                               2  |  -.0567412   .0099949    -5.68   0.000    -.0763409   -.0371415
                               4  |  -.0592608   .0191759    -3.09   0.002    -.0968643   -.0216572
                               5  |  -.0335448   .0082942    -4.04   0.000    -.0498096     -.01728
                                  |
                      yrsusa21910 |
                               1  |   .1298618   .0108193    12.00   0.000     .1086454    .1510783
                               2  |   .0534881   .0069875     7.65   0.000     .0397858    .0671904
                               3  |   .0111448   .0059533     1.87   0.061    -.0005295    .0228192
                               4  |   .0039085   .0060796     0.64   0.520    -.0080135    .0158305
                                  |
                      famsize1910 |   .0043368   .0016844     2.57   0.010     .0010336    .0076399
                     2.school1910 |   .2129777   .0290353     7.34   0.000     .1560402    .2699152
                   2.labforce1910 |   -.138853   .0120321   -11.54   0.000    -.1624476   -.1152584
                     wksunemp1910 |  -.0000963   .0000673    -1.43   0.153    -.0002283    .0000358
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .3950757   .0085509    46.20   0.000     .3783076    .4118438
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2014           0        2014     |
     birthyr |        93           1          92     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 qui su nonat if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .35573701

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .22385418

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2346

.                 est store regA4

.                 
.         reghdfe lasttname_change treat $controls i.year if maxmover==1 & abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    293,062
Absorbing 3 HDFE groups                           F(  28,   2345) =      13.90
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.0444
                                                  Adj R-squared   =     0.0374
                                                  Within R-sq.    =     0.0022
Number of clusters (fips)    =      2,346         Root MSE        =     0.1489

                                                    (Std. err. adjusted for 2,346 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                 lasttname_change | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   .0496615   .0064448     7.71   0.000     .0370233    .0622996
                        draftrate |          0  (omitted)
                      2.urban1910 |   .0053591   .0022428     2.39   0.017     .0009609    .0097572
                                  |
                        skill1910 |
         Professional, Technical  |  -.0104093   .0043389    -2.40   0.017    -.0189178   -.0019008
                         Farmers  |  -.0082261   .0043555    -1.89   0.059     -.016767    .0003149
Managers, Officials, Proprietors  |   -.002141     .00439    -0.49   0.626    -.0107496    .0064676
            Clerical and Kindred  |   .0088605   .0063325     1.40   0.162    -.0035574    .0212784
                   Sales workers  |   .0003059   .0048227     0.06   0.949    -.0091514    .0097631
                       Craftsmen  |   3.43e-06   .0031772     0.00   0.999    -.0062269    .0062338
                      Operatives  |  -.0010967   .0031778    -0.35   0.730    -.0073283    .0051349
   Service Workers (priv househ)  |   .0062253    .004162     1.50   0.135    -.0019362    .0143868
                   Farm Laborers  |  -.0017823   .0040893    -0.44   0.663    -.0098013    .0062368
                        Laborers  |   -.012252   .0030711    -3.99   0.000    -.0182745   -.0062296
                                  |
                       2.farm1910 |   .0040424   .0029522     1.37   0.171    -.0017467    .0098315
                                  |
                      empstat1910 |
                               1  |   .0017813   .0027224     0.65   0.513    -.0035574    .0071199
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |   .0087644   .0065509     1.34   0.181    -.0040818    .0216106
                               4  |   .0045365   .0018953     2.39   0.017     .0008198    .0082531
                                  |
                        marst1910 |
                               1  |   -.002564    .001451    -1.77   0.077    -.0054093    .0002813
                               2  |  -.0077124    .001958    -3.94   0.000    -.0115521   -.0038728
                               4  |   .0059959   .0122153     0.49   0.624     -.017958    .0299498
                               5  |     .00678   .0039355     1.72   0.085    -.0009373    .0144974
                                  |
                      yrsusa21910 |
                               1  |  -.0081515   .0028635    -2.85   0.004    -.0137667   -.0025363
                               2  |  -.0075885   .0024992    -3.04   0.002    -.0124893   -.0026877
                               3  |  -.0060517   .0040582    -1.49   0.136    -.0140098    .0019063
                               4  |   -.005042   .0022086    -2.28   0.023    -.0093729   -.0007111
                                  |
                      famsize1910 |    .000183   .0002538     0.72   0.471    -.0003148    .0006807
                     2.school1910 |   .0027795   .0027482     1.01   0.312    -.0026096    .0081687
                   2.labforce1910 |  -.0030707   .0027331    -1.12   0.261    -.0084302    .0022887
                     wksunemp1910 |   .0000172   .0000144     1.19   0.233    -.0000111    .0000455
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .0146849   .0016958     8.66   0.000     .0113596    .0180103
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2014           0        2014     |
     birthyr |        93           1          92     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 qui su lasttname_change if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .02359228

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .03736191

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2346

.                 est store regA5

.                 
.         reghdfe farmer treat $controls i.year if maxmover==1 & abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    293,062
Absorbing 3 HDFE groups                           F(  28,   2345) =      11.16
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.1088
                                                  Adj R-squared   =     0.1023
                                                  Within R-sq.    =     0.0344
Number of clusters (fips)    =      2,346         Root MSE        =     0.1941

                                                    (Std. err. adjusted for 2,346 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                           farmer | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   .0865665    .008976     9.64   0.000     .0689647    .1041683
                        draftrate |          0  (omitted)
                      2.urban1910 |  -.0169264   .0030125    -5.62   0.000    -.0228338   -.0110189
                                  |
                        skill1910 |
         Professional, Technical  |  -.0547361   .0143257    -3.82   0.000    -.0828285   -.0266437
                         Farmers  |  -.2022362   .0197535   -10.24   0.000    -.2409724      -.1635
Managers, Officials, Proprietors  |  -.0190422   .0062765    -3.03   0.002    -.0313503    -.006734
            Clerical and Kindred  |  -.0155787   .0081528    -1.91   0.056    -.0315662    .0004088
                   Sales workers  |   -.023932   .0068397    -3.50   0.000    -.0373445   -.0105194
                       Craftsmen  |  -.0013584   .0046584    -0.29   0.771    -.0104933    .0077765
                      Operatives  |  -.0076717    .005437    -1.41   0.158    -.0183336    .0029902
   Service Workers (priv househ)  |   .0016593   .0056528     0.29   0.769    -.0094258    .0127444
                   Farm Laborers  |  -.1720447   .0168133   -10.23   0.000    -.2050153   -.1390742
                        Laborers  |   .0056324   .0055462     1.02   0.310    -.0052436    .0165083
                                  |
                       2.farm1910 |   .0270941   .0049573     5.47   0.000     .0173729    .0368153
                                  |
                      empstat1910 |
                               1  |  -.0020851   .0036308    -0.57   0.566     -.009205    .0050347
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |   .0109466   .0076705     1.43   0.154    -.0040952    .0259883
                               4  |   .0124635   .0039305     3.17   0.002      .004756    .0201711
                                  |
                        marst1910 |
                               1  |   .0048343   .0025136     1.92   0.055    -.0000947    .0097634
                               2  |  -.0031517   .0034916    -0.90   0.367    -.0099988    .0036953
                               4  |   .0126006   .0147467     0.85   0.393    -.0163172    .0415184
                               5  |  -.0034261   .0042954    -0.80   0.425    -.0118493     .004997
                                  |
                      yrsusa21910 |
                               1  |  -.0220582   .0058935    -3.74   0.000    -.0336152   -.0105012
                               2  |  -.0159124   .0050814    -3.13   0.002    -.0258769   -.0059479
                               3  |  -.0128459   .0045085    -2.85   0.004    -.0216871   -.0040048
                               4  |   -.004939   .0024963    -1.98   0.048    -.0098341   -.0000438
                                  |
                      famsize1910 |    .001233   .0003463     3.56   0.000      .000554     .001912
                     2.school1910 |  -.0005646   .0038564    -0.15   0.884     -.008127    .0069977
                   2.labforce1910 |   .0282208    .008085     3.49   0.000     .0123663    .0440752
                     wksunemp1910 |  -8.82e-06    .000022    -0.40   0.688    -.0000519    .0000343
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .0326677   .0031946    10.23   0.000     .0264031    .0389322
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2014           0        2014     |
     birthyr |        93           1          92     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 qui su farmer if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .04390539

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .10230593

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2346

.                 est store regA6

. 
. 
.         * store table as tex file
.         #delimit ;
delimiter now ;
.         esttab regA* using "$path/Replication/tables/table2.tex",
>                    replace star(* 0.10 ** 0.05 *** 0.01)
>                    keep(*treat*)
>                    coeflabels(treat "Casualty Quintile = 5")
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")
>                    stats(N R2 ymean, fmt(%9.0fc %9.3fc %9.3fc)                          
>                    label("\\[-1em] \hline Observations"                                                                                                         
>                                          "Adj.\ R$^2$"                                                                                                                  
>                                          "Outcome mean"));
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table2.tex)

.         #delimit cr
delimiter now cr
.         est clear       

. 
.         
.         
. *******************************************************************************************************************************************
. * TABLE 3
. *******************************************************************************************************************************************
. 
. qui

.         reghdfe mover treat 1.treat#1.maxnospeakeng10 $controls i.year if abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(dropped 58 singleton observations)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    583,534
Absorbing 3 HDFE groups                           F(  29,   2390) =     170.35
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.4981
                                                  Adj R-squared   =     0.4962
                                                  Within R-sq.    =     0.0907
Number of clusters (fips)    =      2,391         Root MSE        =     0.3078

                                                    (Std. err. adjusted for 2,391 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                            mover | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   .5442225   .2098972     2.59   0.010     .1326232    .9558218
                                  |
            treat#maxnospeakeng10 |
                             1 1  |   .0994334    .010529     9.44   0.000     .0787864    .1200804
                                  |
                        draftrate |          0  (omitted)
                      2.urban1910 |  -.0206122   .0042602    -4.84   0.000    -.0289662   -.0122582
                                  |
                        skill1910 |
         Professional, Technical  |   .0806179   .0116501     6.92   0.000     .0577725    .1034633
                         Farmers  |  -.0074403   .0108228    -0.69   0.492    -.0286633    .0137827
Managers, Officials, Proprietors  |   .0070907   .0059978     1.18   0.237    -.0046708    .0188521
            Clerical and Kindred  |   -.006177   .0064822    -0.95   0.341    -.0188884    .0065344
                   Sales workers  |    .013165   .0071911     1.83   0.067    -.0009364    .0272664
                       Craftsmen  |   .0115053   .0061803     1.86   0.063     -.000614    .0236247
                      Operatives  |   .0398978   .0086614     4.61   0.000     .0229132    .0568824
   Service Workers (priv househ)  |   .0263267   .0072506     3.63   0.000     .0121086    .0405448
                   Farm Laborers  |   .0531675   .0064492     8.24   0.000     .0405208    .0658141
                        Laborers  |    .090299   .0078191    11.55   0.000      .074966     .105632
                                  |
                       2.farm1910 |  -.0383756   .0045015    -8.53   0.000    -.0472028   -.0295484
                                  |
                      empstat1910 |
                               1  |  -.0228466   .0048022    -4.76   0.000    -.0322635   -.0134297
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |  -.0190043   .0091703    -2.07   0.038     -.036987   -.0010217
                               4  |  -.0473017   .0068381    -6.92   0.000    -.0607108   -.0338926
                                  |
                        marst1910 |
                               1  |  -.1018747   .0046335   -21.99   0.000    -.1109607   -.0927886
                               2  |   .0346419   .0052391     6.61   0.000     .0243681    .0449156
                               4  |   .0030893   .0146537     0.21   0.833     -.025646    .0318246
                               5  |  -.0408288   .0052076    -7.84   0.000    -.0510407    -.030617
                                  |
                      yrsusa21910 |
                               1  |   .1740166   .0145367    11.97   0.000     .1455108    .2025225
                               2  |    .135916   .0116189    11.70   0.000     .1131318    .1587003
                               3  |   .0864917   .0064261    13.46   0.000     .0738903    .0990931
                               4  |   .0393771   .0029018    13.57   0.000     .0336869    .0450673
                                  |
                      famsize1910 |  -.0126742   .0004416   -28.70   0.000    -.0135402   -.0118083
                     2.school1910 |  -.0275296   .0053573    -5.14   0.000    -.0380349   -.0170242
                   2.labforce1910 |   .0189897   .0044043     4.31   0.000     .0103531    .0276262
                     wksunemp1910 |  -.0001299    .000026    -4.99   0.000    -.0001809   -.0000788
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .2085317   .0406936     5.12   0.000     .1287333    .2883301
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2098           0        2098     |
     birthyr |        94           1          93     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .49622702

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2391

.                 est store regC1

. 
.         reghdfe mover treat 1.treat#1.maxnospeakeng10 1.treat#1.wilhelmfrst $controls i.year if abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(dropped 58 singleton observations)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    583,534
Absorbing 3 HDFE groups                           F(  30,   2390) =     166.32
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.4982
                                                  Adj R-squared   =     0.4962
                                                  Within R-sq.    =     0.0907
Number of clusters (fips)    =      2,391         Root MSE        =     0.3078

                                                    (Std. err. adjusted for 2,391 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                            mover | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   .5441672   .2098861     2.59   0.010     .1325895     .955745
                                  |
            treat#maxnospeakeng10 |
                             1 1  |   .0994366   .0105291     9.44   0.000     .0787895    .1200836
                                  |
                treat#wilhelmfrst |
                             1 1  |   .1289779   .0630813     2.04   0.041     .0052782    .2526775
                                  |
                        draftrate |          0  (omitted)
                      2.urban1910 |  -.0206071   .0042592    -4.84   0.000    -.0289592   -.0122551
                                  |
                        skill1910 |
         Professional, Technical  |   .0805767   .0116529     6.91   0.000     .0577258    .1034276
                         Farmers  |  -.0074763   .0108293    -0.69   0.490    -.0287121    .0137596
Managers, Officials, Proprietors  |   .0070961   .0059979     1.18   0.237    -.0046655    .0188576
            Clerical and Kindred  |  -.0061592   .0064811    -0.95   0.342    -.0188683    .0065499
                   Sales workers  |   .0131882   .0071896     1.83   0.067    -.0009103    .0272866
                       Craftsmen  |   .0115066   .0061807     1.86   0.063    -.0006136    .0236267
                      Operatives  |   .0398933   .0086635     4.60   0.000     .0229045     .056882
   Service Workers (priv househ)  |   .0263199   .0072614     3.62   0.000     .0120806    .0405591
                   Farm Laborers  |   .0531279   .0064561     8.23   0.000     .0404679     .065788
                        Laborers  |   .0902946   .0078206    11.55   0.000     .0749587    .1056306
                                  |
                       2.farm1910 |  -.0383768   .0045013    -8.53   0.000    -.0472036   -.0295501
                                  |
                      empstat1910 |
                               1  |  -.0228475   .0048026    -4.76   0.000    -.0322651   -.0134298
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |  -.0189721   .0091707    -2.07   0.039    -.0369554   -.0009887
                               4  |    -.04729   .0068381    -6.92   0.000    -.0606993   -.0338807
                                  |
                        marst1910 |
                               1  |  -.1018684   .0046317   -21.99   0.000     -.110951   -.0927858
                               2  |   .0346531    .005238     6.62   0.000     .0243817    .0449246
                               4  |   .0031378   .0146522     0.21   0.830    -.0255945      .03187
                               5  |  -.0408594   .0052059    -7.85   0.000     -.051068   -.0306509
                                  |
                      yrsusa21910 |
                               1  |   .1740214   .0145351    11.97   0.000     .1455186    .2025241
                               2  |   .1359224   .0116209    11.70   0.000     .1131343    .1587104
                               3  |   .0864768   .0064253    13.46   0.000     .0738771    .0990766
                               4  |   .0393711   .0029025    13.56   0.000     .0336793    .0450628
                                  |
                      famsize1910 |  -.0126726   .0004418   -28.69   0.000    -.0135389   -.0118063
                     2.school1910 |   -.027517   .0053541    -5.14   0.000    -.0380161   -.0170179
                   2.labforce1910 |   .0190037    .004405     4.31   0.000     .0103657    .0276416
                     wksunemp1910 |  -.0001299    .000026    -4.99   0.000     -.000181   -.0000788
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .2085173   .0406919     5.12   0.000     .1287223    .2883124
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2098           0        2098     |
     birthyr |        94           1          93     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .49623399

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2391

.                 est store regC2

. 
.         reghdfe mover treat 1.treat#1.maxnospeakeng10 1.treat#1.wilhelmfrst 1.treat#1.germansurname_match $controls i.year if abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(dropped 58 singleton observations)
(MWFE estimator converged in 6 iterations)
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    583,534
Absorbing 3 HDFE groups                           F(  31,   2390) =     205.16
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.4990
                                                  Adj R-squared   =     0.4971
                                                  Within R-sq.    =     0.0922
Number of clusters (fips)    =      2,391         Root MSE        =     0.3075

                                                    (Std. err. adjusted for 2,391 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                            mover | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |   .5308576   .2091967     2.54   0.011     .1206318    .9410834
                                  |
            treat#maxnospeakeng10 |
                             1 1  |   .1032632   .0103888     9.94   0.000     .0828912    .1236352
                                  |
                treat#wilhelmfrst |
                             1 1  |    .110597   .0612376     1.81   0.071    -.0094873    .2306813
                                  |
        treat#germansurname_match |
                             1 1  |   .0744626   .0076411     9.74   0.000     .0594786    .0894465
                                  |
                        draftrate |          0  (omitted)
                      2.urban1910 |  -.0212814    .004223    -5.04   0.000    -.0295626   -.0130003
                                  |
                        skill1910 |
         Professional, Technical  |   .0802475   .0115654     6.94   0.000     .0575682    .1029268
                         Farmers  |  -.0073458   .0107642    -0.68   0.495    -.0284539    .0137624
Managers, Officials, Proprietors  |   .0067545   .0060231     1.12   0.262    -.0050565    .0185656
            Clerical and Kindred  |  -.0065927   .0064769    -1.02   0.309    -.0192937    .0061083
                   Sales workers  |   .0126301    .007176     1.76   0.079    -.0014417     .026702
                       Craftsmen  |   .0111449   .0061568     1.81   0.070    -.0009282    .0232181
                      Operatives  |   .0401593   .0086388     4.65   0.000     .0232191    .0570996
   Service Workers (priv househ)  |     .02631   .0072351     3.64   0.000     .0121222    .0404978
                   Farm Laborers  |    .053373   .0064295     8.30   0.000      .040765    .0659809
                        Laborers  |   .0911643    .007744    11.77   0.000     .0759787      .10635
                                  |
                       2.farm1910 |  -.0386993    .004493    -8.61   0.000    -.0475098   -.0298888
                                  |
                      empstat1910 |
                               1  |  -.0227492   .0047597    -4.78   0.000    -.0320828   -.0134156
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |  -.0195092   .0091639    -2.13   0.033    -.0374793   -.0015392
                               4  |  -.0482794   .0068022    -7.10   0.000    -.0616183   -.0349405
                                  |
                        marst1910 |
                               1  |  -.1013835   .0046958   -21.59   0.000    -.1105917   -.0921752
                               2  |   .0353328   .0051863     6.81   0.000     .0251626    .0455029
                               4  |   .0027593   .0145216     0.19   0.849     -.025717    .0312356
                               5  |  -.0409585   .0052285    -7.83   0.000    -.0512114   -.0307056
                                  |
                      yrsusa21910 |
                               1  |    .174255   .0145939    11.94   0.000     .1456371    .2028729
                               2  |   .1362397   .0117405    11.60   0.000      .113217    .1592623
                               3  |   .0864858   .0064779    13.35   0.000     .0737828    .0991887
                               4  |   .0392786   .0029051    13.52   0.000     .0335817    .0449754
                                  |
                      famsize1910 |  -.0126653   .0004423   -28.64   0.000    -.0135326    -.011798
                     2.school1910 |  -.0278077   .0053622    -5.19   0.000    -.0383226   -.0172927
                   2.labforce1910 |    .019581   .0044126     4.44   0.000      .010928     .028234
                     wksunemp1910 |   -.000132   .0000258    -5.11   0.000    -.0001826   -.0000814
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .2085239   .0406866     5.13   0.000     .1287392    .2883087
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2098           0        2098     |
     birthyr |        94           1          93     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .49706482

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2391

.                 est store regC3

. 
.         reghdfe mover treat 1.treat#1.maxnospeakeng10 1.treat#1.wilhelmfrst 1.treat#1.germansurname_match 1.treat#i.yrsusa2 $controls i.year if abe_nysiis_standard==1, a(fips1910 birthyr bpl) cluster(fips)
(dropped 58 singleton observations)
(MWFE estimator converged in 6 iterations)
note: 1.treat#5.yrsusa2 omitted because of collinearity
note: draftrate omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 3.empstat1910 omitted because of collinearity
note: 1920.year omitted because of collinearity

HDFE Linear regression                            Number of obs   =    583,534
Absorbing 3 HDFE groups                           F(  35,   2390) =     226.64
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.5029
                                                  Adj R-squared   =     0.5010
                                                  Within R-sq.    =     0.0992
Number of clusters (fips)    =      2,391         Root MSE        =     0.3063

                                                    (Std. err. adjusted for 2,391 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                            mover | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                            treat |    .484953   .2017252     2.40   0.016     .0893786    .8805274
                                  |
            treat#maxnospeakeng10 |
                             1 1  |   .0729476   .0086875     8.40   0.000     .0559119    .0899833
                                  |
                treat#wilhelmfrst |
                             1 1  |   .1199586   .0597577     2.01   0.045     .0027762    .2371409
                                  |
        treat#germansurname_match |
                             1 1  |   .0766457   .0070858    10.82   0.000     .0627508    .0905406
                                  |
                    treat#yrsusa2 |
                     1#0-5 years  |   .1862056   .0197375     9.43   0.000     .1475012    .2249099
                    1#6-10 years  |    .245115   .0169231    14.48   0.000     .2119296    .2783004
                   1#11-15 years  |    .088426   .0121435     7.28   0.000     .0646131    .1122389
                   1#16-20 years  |   .0605967    .011557     5.24   0.000      .037934    .0832594
                     1#21+ years  |          0  (omitted)
                                  |
                        draftrate |          0  (omitted)
                      2.urban1910 |  -.0211926   .0042613    -4.97   0.000    -.0295489   -.0128363
                                  |
                        skill1910 |
         Professional, Technical  |   .0813395   .0114672     7.09   0.000     .0588528    .1038263
                         Farmers  |  -.0095776   .0102931    -0.93   0.352     -.029762    .0106068
Managers, Officials, Proprietors  |   .0067943   .0060001     1.13   0.258    -.0049716    .0185602
            Clerical and Kindred  |  -.0059691   .0064339    -0.93   0.354    -.0185857    .0066475
                   Sales workers  |   .0130691   .0070331     1.86   0.063    -.0007226    .0268607
                       Craftsmen  |   .0123382   .0060616     2.04   0.042     .0004517    .0242248
                      Operatives  |    .039427   .0083822     4.70   0.000     .0229897    .0558642
   Service Workers (priv househ)  |   .0275629   .0070591     3.90   0.000     .0137203    .0414054
                   Farm Laborers  |    .056045   .0063209     8.87   0.000     .0436499    .0684401
                        Laborers  |   .0907042   .0077116    11.76   0.000     .0755822    .1058263
                                  |
                       2.farm1910 |  -.0364602   .0043461    -8.39   0.000    -.0449827   -.0279377
                                  |
                      empstat1910 |
                               1  |  -.0231972   .0046726    -4.96   0.000      -.03236   -.0140344
                               2  |          0  (omitted)
                               3  |          0  (omitted)
                                  |
                          lit1910 |
                               3  |  -.0159745   .0090563    -1.76   0.078    -.0337334    .0017844
                               4  |  -.0445383   .0067557    -6.59   0.000    -.0577859   -.0312907
                                  |
                        marst1910 |
                               1  |  -.0935302   .0045645   -20.49   0.000     -.102481   -.0845794
                               2  |   .0421931   .0051178     8.24   0.000     .0321573    .0522289
                               4  |   .0095483   .0145041     0.66   0.510    -.0188937    .0379903
                               5  |  -.0323549   .0051141    -6.33   0.000    -.0423835   -.0223264
                                  |
                      yrsusa21910 |
                               1  |   .1513406   .0149223    10.14   0.000     .1220787    .1806025
                               2  |   .1186562   .0120625     9.84   0.000     .0950022    .1423102
                               3  |   .0801003   .0064849    12.35   0.000     .0673837     .092817
                               4  |   .0368949   .0026734    13.80   0.000     .0316526    .0421373
                                  |
                      famsize1910 |  -.0124527   .0004628   -26.91   0.000    -.0133602   -.0115453
                     2.school1910 |  -.0346138    .005676    -6.10   0.000    -.0457442   -.0234834
                   2.labforce1910 |   .0213322   .0044277     4.82   0.000     .0126497    .0300146
                     wksunemp1910 |  -.0001296   .0000256    -5.06   0.000    -.0001798   -.0000793
                                  |
                             year |
                            1920  |          0  (omitted)
                                  |
                            _cons |   .2080928   .0389816     5.34   0.000     .1316516    .2845339
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
    fips1910 |      2098           0        2098     |
     birthyr |        94           1          93     |
         bpl |         3           1           2    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .50095549

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2391

.                 est store regC4

. 
.         * store table as tex file
.         #delimit ;
delimiter now ;
.         esttab regC* using "$path/Replication/tables/table3.tex",
>                    replace star(* 0.10 ** 0.05 *** 0.01)
>                    keep(treat 1.treat#1.maxnospeakeng10 1.treat#1.wilhelmfrst 1.treat#1.germansurname_match 1.treat#1.yrsusa2 1.treat#2.yrsusa2 1.treat#3.yrsusa2 1.treat#4.yrsusa2)
>                    coeflabels(treat "Casualty Quintile = 5"
>                                           1.treat#1.maxnospeakeng10 "Does not speak English"
>                                           1.treat#1.wilhelmfrst "First name is Wilhelm"
>                                           1.treat#1.germansurname_match "German surname"
>                                           1.treat#1.yrsusa2 "In U.S. 0-5 years"
>                                           1.treat#2.yrsusa2 "In U.S. 5-10 years"
>                                           1.treat#3.yrsusa2 "In U.S. 11-15 years"
>                                           1.treat#4.yrsusa2 "In U.S. 16-20 years")
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")
>                    stats(N R2 , fmt(%9.0fc %9.3fc)                              
>                    label("\\[-1em] \hline Observations"                                                                                                         
>                                          "Adj.\ R$^2$"));
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table3.tex)

.         #delimit cr
delimiter now cr
.         est clear       

.                 
.         
. *******************************************************************************************************************************************
. * TABLE 4
. *******************************************************************************************************************************************
. use "$path/Replication/cleaned_data/county_panel_shortrun.dta", clear

. 
. 
.         * globals w controls for OLS and IV
.         global controls "c.prewarGer i.year draftrate_amm1845post c.prewarPOP#1.post c.prewarMFGL#1.post c.prewarMF#1.post c.prewarurb#1.post"

. 
.         * w time varying pop control
.         global controls2 "c.prewarGer i.year draftrate_amm1845post c.prewarPOP#1.post c.prewarMFGL#1.post c.prewarMF#1.post totpop mtot c.prewarurb#1.post"

. 
.         
.         * compute mean outflow
.         qui reghdfe lnwages outflow prewarGer draftrate_amm1845post i.year if year>1890, a(id) cluster(id)

.         qui su outflow if e(sample) & year==1920

.         scalar meanout = `r(mean)'

. 
. 
.         * TOP PANEL
.         ***************************************************************************************************************************************
.         
.         * PANEL A COLUMN 1: control for prewar ger and draft rate
.         reghdfe lnwages outflow prewarGer draftrate_amm1845post i.year if year>1890, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =     10,353
Absorbing 1 HDFE group                            F(   7,   2226) =  254948.28
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9019
                                                  Adj R-squared   =     0.8749
                                                  Within R-sq.    =     0.8583
Number of clusters (id)      =      2,227         Root MSE        =     0.1772

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0116411   .0044966    -2.59   0.010     -.020459   -.0028232
            prewarGer |   .0086275   .0009482     9.10   0.000      .006768    .0104869
draftrate_amm1845post |   .0000256   .0008213     0.03   0.975    -.0015849    .0016362
                      |
                 year |
                1910  |    .421887   .0057042    73.96   0.000     .4107009    .4330731
                1920  |  -.7343438   .0115854   -63.39   0.000    -.7570632   -.7116244
                1930  |  -.3397767   .0115629   -29.39   0.000    -.3624519   -.3171014
                1940  |  -.2126878   .0120055   -17.72   0.000    -.2362309   -.1891448
                      |
                _cons |   1.485603      .0051   291.29   0.000     1.475601    1.495604
---------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .87487733

.         estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.00415013

.         estadd local cont1 "Yes"

added macro:
              e(cont1) : "Yes"

.         est store regB1

.         
.         * PANEL A COLUMN 2: with the above AND pre-war pop controls
.         reghdfe lnwages outflow prewarGer draftrate_amm1845post c.prewarPOP#1.post c.prewarMF#1.post i.year if year>1890 , a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =     10,353
Absorbing 1 HDFE group                            F(   9,   2226) =  153220.58
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9027
                                                  Adj R-squared   =     0.8759
                                                  Within R-sq.    =     0.8596
Number of clusters (id)      =      2,227         Root MSE        =     0.1764

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0151344    .004281    -3.54   0.000    -.0235296   -.0067392
            prewarGer |   .0086758   .0009449     9.18   0.000     .0068227    .0105289
draftrate_amm1845post |   .0005212   .0008997     0.58   0.562    -.0012431    .0022855
                      |
     post#c.prewarPOP |
                   1  |   1.82e-06   2.26e-07     8.06   0.000     1.38e-06    2.26e-06
                      |
      post#c.prewarMF |
                   1  |  -.0345918   .0171563    -2.02   0.044    -.0682358   -.0009478
                      |
                 year |
                1910  |   .4222196   .0057119    73.92   0.000     .4110183    .4334208
                1920  |  -.7335313   .0219771   -33.38   0.000    -.7766291   -.6904335
                1930  |  -.3404938   .0222285   -15.32   0.000    -.3840845   -.2969031
                1940  |   -.213857   .0225751    -9.47   0.000    -.2581274   -.1695866
                      |
                _cons |   1.485142   .0050815   292.26   0.000     1.475177    1.495107
---------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .87593442

.         estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.00539552

.         estadd local cont1 "Yes"

added macro:
              e(cont1) : "Yes"

.         estadd local cont2 "Yes"

added macro:
              e(cont2) : "Yes"

.         est store regB2

.         
.         * PANEL A COLUMN 3: with the above AND pre-war mfg and urbanization
.         reghdfe lnwages outflow prewarGer draftrate_amm1845post c.prewarPOP#1.post c.prewarMF#1.post c.prewarMFGL#1.post c.prewarurb#1.post i.year if year>1890 , a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =     10,353
Absorbing 1 HDFE group                            F(  11,   2226) =  125154.84
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9028
                                                  Adj R-squared   =     0.8760
                                                  Within R-sq.    =     0.8596
Number of clusters (id)      =      2,227         Root MSE        =     0.1764

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0154974   .0042679    -3.63   0.000    -.0238668    -.007128
            prewarGer |   .0087165   .0009447     9.23   0.000      .006864    .0105691
draftrate_amm1845post |   .0004619   .0008872     0.52   0.603    -.0012779    .0022017
                      |
     post#c.prewarPOP |
                   1  |   1.73e-06   2.88e-07     6.01   0.000     1.17e-06    2.29e-06
                      |
      post#c.prewarMF |
                   1  |  -.0352322   .0172814    -2.04   0.042    -.0691216   -.0013427
                      |
    post#c.prewarMFGL |
                   1  |   .0020582   .0011612     1.77   0.076    -.0002189    .0043354
                      |
     post#c.prewarurb |
                   1  |   -.000661   .0004051    -1.63   0.103    -.0014555    .0001334
                      |
                 year |
                1910  |   .4223411    .005707    74.00   0.000     .4111495    .4335327
                1920  |  -.7347592   .0223437   -32.88   0.000    -.7785759   -.6909425
                1930  |  -.3417982   .0226171   -15.11   0.000    -.3861509   -.2974454
                1940  |  -.2152175   .0229517    -9.38   0.000    -.2602264   -.1702085
                      |
                _cons |   1.485015   .0050779   292.45   0.000     1.475057    1.494973
---------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .8759512

.         estadd scalar cl = e(df_a_nested)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.00552492

.         estadd local cont1 "Yes"

added macro:
              e(cont1) : "Yes"

.         estadd local cont2 "Yes"

added macro:
              e(cont2) : "Yes"

.         estadd local cont3 "Yes"

added macro:
              e(cont3) : "Yes"

.         est store regB3

.         
.         * PANEL A COLUMN 4: with the above AND time varying population controls
.         reghdfe lnwages outflow prewarGer mtot totpop draftrate_amm1845post c.prewarPOP#1.post c.prewarMF#1.post c.prewarMFGL#1.post c.prewarurb#1.post i.year if year>1890 , a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =     10,353
Absorbing 1 HDFE group                            F(  13,   2226) =  111666.83
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9041
                                                  Adj R-squared   =     0.8776
                                                  Within R-sq.    =     0.8615
Number of clusters (id)      =      2,227         Root MSE        =     0.1752

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0159315   .0041876    -3.80   0.000    -.0241435   -.0077194
            prewarGer |   .0092111   .0009595     9.60   0.000     .0073296    .0110927
                 mtot |   .0000137   5.88e-06     2.33   0.020     2.15e-06    .0000252
               totpop |  -5.03e-06   2.92e-06    -1.72   0.085    -.0000108    6.93e-07
draftrate_amm1845post |  -.0010502   .0007549    -1.39   0.164    -.0025306    .0004303
                      |
     post#c.prewarPOP |
                   1  |   1.08e-06   2.93e-07     3.67   0.000     5.00e-07    1.65e-06
                      |
      post#c.prewarMF |
                   1  |  -.0393525   .0171924    -2.29   0.022    -.0730672   -.0056378
                      |
    post#c.prewarMFGL |
                   1  |   .0014403   .0011609     1.24   0.215    -.0008362    .0037168
                      |
     post#c.prewarurb |
                   1  |  -.0020569   .0005551    -3.71   0.000    -.0031454   -.0009684
                      |
                 year |
                1910  |   .4171664   .0057154    72.99   0.000     .4059582    .4283745
                1920  |  -.7056397   .0229716   -30.72   0.000    -.7506877   -.6605917
                1930  |  -.3176435   .0229894   -13.82   0.000    -.3627265   -.2725605
                1940  |   -.194429   .0231657    -8.39   0.000    -.2398577   -.1490004
                      |
                _cons |   1.440046   .0084952   169.51   0.000     1.423387    1.456705
---------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .87762353

.         estadd scalar cl = e(df_a_nested)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.00567967

.         estadd local cont1 "Yes"

added macro:
              e(cont1) : "Yes"

.         estadd local cont2 "Yes"

added macro:
              e(cont2) : "Yes"

.         estadd local cont3 "Yes"

added macro:
              e(cont3) : "Yes"

.         estadd local cont4 "Yes"

added macro:
              e(cont4) : "Yes"

.         est store regB4

.         
. 
.         * generate upper panel for the table
.         #delimit ;
delimiter now ;
.         esttab regB* using "$path/Replication/tables/table4_panelA.tex",                        
>                    replace star(* 0.10 ** 0.05 *** 0.01)                                                                
>                    keep(*outflow*)                                                                                                              
>                    coeflabels(outflow "Post-WWI $\times$ German Outflow$\_{1910-20}$")  
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")                                                               
>                    stats(N cl meaneff R2 cont1 cont2 cont3 cont4, fmt(%9.0fc %9.0fc %9.3fc %9.3fc %9s %9s %9s %9s)                      
>                    label("\\[-1.5em] \hline Observations"                                                                                               
>                                  "Counties"                     
>                                  "Effect at mean outflow"
>                                  "Adj.\ R$^2$"                                                                                                  
>                                  "\\[-1.5em] \hline Pre-war \% Germans and draft rate"                                                                          
>                                  "Pre-war population and sex ratio"                                                                     
>                                  "Pre-war manufacturing and urbanization"                                               
>                                  "Time-varying population"));
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table4_panelA.tex)

.         #delimit cr
delimiter now cr
.         est clear

. 
. 
.         * BOTTOM PANEL
.         ***************************************************************************************************************************************
. 
.         * PANEL B COLUMN 1: log firm size
.         reghdfe lnfirmsize outflow $controls if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =     10,353
Absorbing 1 HDFE group                            F(  11,   2226) =     915.46
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.8784
                                                  Adj R-squared   =     0.8449
                                                  Within R-sq.    =     0.6691
Number of clusters (id)      =      2,227         Root MSE        =     0.4346

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
           lnfirmsize | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0377789   .0126537    -2.99   0.003    -.0625932   -.0129645
            prewarGer |  -.0030187   .0016083    -1.88   0.061    -.0061726    .0001353
                      |
                 year |
                1910  |   .2415179   .0059941    40.29   0.000     .2297634    .2532725
                1920  |    .902957   .0861903    10.48   0.000     .7339352    1.071979
                1930  |   1.356374   .0857288    15.82   0.000     1.188258    1.524491
                1940  |   1.431394   .0874185    16.37   0.000     1.259963    1.602824
                      |
draftrate_amm1845post |    .002028   .0026572     0.76   0.445     -.003183    .0072389
                      |
     post#c.prewarPOP |
                   1  |   .0000126   1.11e-06    11.35   0.000     .0000105    .0000148
                      |
    post#c.prewarMFGL |
                   1  |  -.0181431   .0043448    -4.18   0.000    -.0266634   -.0096227
                      |
      post#c.prewarMF |
                   1  |  -.2186336   .0732321    -2.99   0.003    -.3622439   -.0750233
                      |
     post#c.prewarurb |
                   1  |   -.007752    .001404    -5.52   0.000    -.0105052   -.0049988
                      |
                _cons |    1.54482   .0093882   164.55   0.000      1.52641    1.563231
---------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .84494159

.         estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.01346842

.         estadd local cont "Yes"

added macro:
               e(cont) : "Yes"

.         est store regL1

.         
.         * PANEL B COLUMN 2: log mfg estabs
.         reghdfe lnmfgestab outflow $controls if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =     10,353
Absorbing 1 HDFE group                            F(  11,   2226) =    1541.45
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9123
                                                  Adj R-squared   =     0.8881
                                                  Within R-sq.    =     0.7639
Number of clusters (id)      =      2,227         Root MSE        =     0.3655

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
           lnmfgestab | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0288864   .0126473    -2.28   0.022    -.0536881   -.0040848
            prewarGer |     .00553    .001942     2.85   0.004     .0017216    .0093384
                      |
                 year |
                1910  |   .1381679   .0115763    11.94   0.000     .1154665    .1608693
                1920  |  -1.041064   .0650235   -16.01   0.000    -1.168577   -.9135504
                1930  |  -1.562048    .065533   -23.84   0.000     -1.69056   -1.433535
                1940  |  -1.745877   .0651914   -26.78   0.000    -1.873719   -1.618034
                      |
draftrate_amm1845post |   .0129516   .0023582     5.49   0.000     .0083271     .017576
                      |
     post#c.prewarPOP |
                   1  |  -7.84e-06   9.32e-07    -8.41   0.000    -9.66e-06   -6.01e-06
                      |
    post#c.prewarMFGL |
                   1  |   .0319538   .0040566     7.88   0.000     .0239986     .039909
                      |
      post#c.prewarMF |
                   1  |   .2703776   .0552757     4.89   0.000     .1619802     .378775
                      |
     post#c.prewarurb |
                   1  |   .0102214   .0018142     5.63   0.000     .0066637    .0137791
                      |
                _cons |   4.323054   .0102689   420.98   0.000     4.302917    4.343192
---------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .88806926

.         estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.01029821

.         estadd local cont "Yes"

added macro:
               e(cont) : "Yes"

.         est store regL2

.         
.         * PANEL B COLUMN 3: log mfg labor
.         reghdfe lnmfglaborpc outflow $controls if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =     10,353
Absorbing 1 HDFE group                            F(  11,   2226) =     247.06
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.8689
                                                  Adj R-squared   =     0.8328
                                                  Within R-sq.    =     0.0849
Number of clusters (id)      =      2,227         Root MSE        =     0.5418

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
         lnmfglaborpc | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0374425   .0144685    -2.59   0.010    -.0658157   -.0090693
            prewarGer |   .0057374   .0019544     2.94   0.003     .0019048      .00957
                      |
                 year |
                1910  |   .3473743   .0122245    28.42   0.000     .3234016    .3713469
                1920  |   .3537314   .0916021     3.86   0.000     .1740969    .5333659
                1930  |   .2793759   .0917155     3.05   0.002      .099519    .4592328
                1940  |   .0991157   .0933065     1.06   0.288    -.0838612    .2820925
                      |
draftrate_amm1845post |  -.0004481   .0026655    -0.17   0.867    -.0056751     .004779
                      |
     post#c.prewarPOP |
                   1  |   5.77e-06   1.09e-06     5.31   0.000     3.64e-06    7.90e-06
                      |
    post#c.prewarMFGL |
                   1  |  -.0192327   .0040118    -4.79   0.000    -.0270999   -.0113655
                      |
      post#c.prewarMF |
                   1  |  -.1682836   .0758554    -2.22   0.027    -.3170383    -.019529
                      |
     post#c.prewarurb |
                   1  |  -.0050448   .0011755    -4.29   0.000      -.00735   -.0027396
                      |
                _cons |  -4.264212   .0136798  -311.71   0.000    -4.291039   -4.237386
---------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .83278845

.         estadd scalar cl = e(df_a_nested)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.0133485

.         estadd local cont "Yes"

added macro:
               e(cont) : "Yes"

.         est store regL3

.         
.         * PANEL B COLUMN 4: log output per capita
.         reghdfe lnmfgoutperfirm outflow $controls if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =     10,353
Absorbing 1 HDFE group                            F(  11,   2226) =     511.71
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.7331
                                                  Adj R-squared   =     0.6595
                                                  Within R-sq.    =     0.5442
Number of clusters (id)      =      2,227         Root MSE        =     0.3428

                                          (Std. err. adjusted for 2,227 clusters in id)
---------------------------------------------------------------------------------------
                      |               Robust
      lnmfgoutperfirm | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0167598   .0089968    -1.86   0.063    -.0344028    .0008832
            prewarGer |  -.0052832   .0015558    -3.40   0.001    -.0083342   -.0022322
                      |
                 year |
                1910  |  -.1489937   .0071714   -20.78   0.000     -.163057   -.1349304
                1920  |   .7188708   .0586265    12.26   0.000     .6039024    .8338392
                1930  |    1.06323   .0595586    17.85   0.000     .9464337    1.180026
                1940  |   1.220226   .0605285    20.16   0.000     1.101527    1.338924
                      |
draftrate_amm1845post |   -.004713   .0024232    -1.94   0.052     -.009465    .0000389
                      |
     post#c.prewarPOP |
                   1  |  -.0000125   8.00e-07   -15.60   0.000     -.000014   -.0000109
                      |
    post#c.prewarMFGL |
                   1  |  -.0371212   .0032807   -11.32   0.000    -.0435547   -.0306878
                      |
      post#c.prewarMF |
                   1  |  -.0964264   .0475264    -2.03   0.043    -.1896272   -.0032257
                      |
     post#c.prewarurb |
                   1  |   .0050939   .0010085     5.05   0.000     .0031162    .0070716
                      |
                _cons |   .2934033   .0072075    40.71   0.000     .2792691    .3075375
---------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .65946815

.         estadd scalar cl = e(df_a_nested)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.00597496

.         estadd local cont "Yes"

added macro:
               e(cont) : "Yes"

.         est store regL4

.         
.         
.         * generate lower panel for the table
.         #delimit ;
delimiter now ;
.         esttab regL* using "$path/Replication/tables/table4_panelB.tex",
>                    replace star(* 0.10 ** 0.05 *** 0.01)
>                    keep(*outflow*)
>                    coeflabels(outflow "Post-WWI $\times$ German Outflow$\_{1910-20}$")
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")
>                    stats(N cl meaneff R2 cont, fmt(%9.0fc %9.0fc %9.3fc %9.3fc %9s)
>                    label("\\[-1.5em] \hline Observations"
>                                  "Counties"
>                                  "Effect at mean outflow"
>                                  "Adj.\ R$^2$"
>                                  "\\[-1.5em] \hline Controls"));
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table4_panelB.tex)

.         #delimit cr
delimiter now cr
.         est clear

.         
.         
.         
. *******************************************************************************************************************************************
. * TABLE 5
. *******************************************************************************************************************************************
.         
.         * compute mean outflow
.         qui reghdfe lnwages outflow prewarGer draftrate_amm1845post i.year if year>1890, a(id) cluster(id)

.         qui su outflow if e(sample) & year==1920

.         scalar meanout = `r(mean)'

. 
. 
.         * TOP PANEL
.         *************************************************************************************************************************************** 
. 
.         * PANEL A COLUMN 1: control for prewar ger and draft rate
.         ivreghdfe lnwages (outflow= 5.Q5_casrate_1845amm#1.post) prewarGer draftrate_amm1845post c.prewarPOP#1.post i.year if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on id

Number of clusters (id) =         2227                Number of obs =    10353
                                                      F(  8,  2226) =  1.4e+05
                                                      Prob > F      =   0.0000
Total (centered) SS     =   1798.58375                Centered R2   =   0.8581
Total (uncentered) SS   =   1798.58375                Uncentered R2 =   0.8581
Residual SS             =  255.2670512                Root MSE      =    .1571

---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0584427   .0309813    -1.89   0.059    -.1191981    .0023126
            prewarGer |   .0148134   .0046216     3.21   0.001     .0057503    .0238765
draftrate_amm1845post |   .0009143   .0011306     0.81   0.419    -.0013029    .0031314
                      |
     post#c.prewarPOP |
                   1  |   2.20e-06   2.66e-07     8.26   0.000     1.68e-06    2.72e-06
                      |
                 year |
                1900  |          0  (empty)
                1910  |   .4370893   .0126958    34.43   0.000     .4121925    .4619861
                1920  |  -.7691937   .0135193   -56.90   0.000    -.7957054   -.7426819
                1930  |  -.3759192   .0137682   -27.30   0.000     -.402919   -.3489194
                1940  |  -.2490867    .014223   -17.51   0.000    -.2769785   -.2211949
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             32.171
                                                   Chi-sq(1) P-val =    0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              235.272
                         (Kleibergen-Paap rk Wald F statistic):         33.977
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         outflow
Included instruments: prewarGer draftrate_amm1845post 1.post#c.prewarPOP
                      1910.year 1920.year 1930.year 1940.year
Excluded instruments: 5.Q5_casrate_1845amm#1.post
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  33.977492

.         estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.02083522

.         estadd local cont1 "Yes"

added macro:
              e(cont1) : "Yes"

.         est store regB1

.         
.         * PANEL A COLUMN 2: with the above AND pre-war pop controls
.         ivreghdfe lnwages (outflow= 5.Q5_casrate_1845amm#1.post) prewarGer draftrate_amm1845post c.prewarPOP#1.post c.prewarMF#1.post i.year if year>1890 , a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on id

Number of clusters (id) =         2227                Number of obs =    10353
                                                      F(  9,  2226) =  1.3e+05
                                                      Prob > F      =   0.0000
Total (centered) SS     =   1798.58375                Centered R2   =   0.8585
Total (uncentered) SS   =   1798.58375                Uncentered R2 =   0.8585
Residual SS             =  254.5638024                Root MSE      =    .1569

---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0539065   .0305051    -1.77   0.077    -.1137279    .0059149
            prewarGer |   .0143766   .0045612     3.15   0.002      .005432    .0233213
draftrate_amm1845post |   .0012876   .0012194     1.06   0.291    -.0011037     .003679
                      |
     post#c.prewarPOP |
                   1  |   1.99e-06   2.69e-07     7.40   0.000     1.46e-06    2.52e-06
                      |
      post#c.prewarMF |
                   1  |  -.0351978   .0174319    -2.02   0.044    -.0693824   -.0010133
                      |
                 year |
                1900  |          0  (empty)
                1910  |   .4360857   .0125818    34.66   0.000     .4114125    .4607589
                1920  |  -.7314075   .0222882   -32.82   0.000    -.7751153   -.6876998
                1930  |  -.3382812   .0225877   -14.98   0.000    -.3825764    -.293986
                1940  |  -.2113317   .0229554    -9.21   0.000    -.2563479   -.1663154
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             32.291
                                                   Chi-sq(1) P-val =    0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              236.894
                         (Kleibergen-Paap rk Wald F statistic):         34.113
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         outflow
Included instruments: prewarGer draftrate_amm1845post 1.post#c.prewarPOP
                      1.post#c.prewarMF 1910.year 1920.year 1930.year 1940.year
Excluded instruments: 5.Q5_casrate_1845amm#1.post
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  34.11303

.         estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.01921804

.         estadd local cont1 "Yes"

added macro:
              e(cont1) : "Yes"

.         estadd local cont2 "Yes"

added macro:
              e(cont2) : "Yes"

.         est store regB2

.         
.         * PANEL A COLUMN 3: with the above AND pre-war mfg and urbanization
.         ivreghdfe lnwages (outflow= 5.Q5_casrate_1845amm#1.post) prewarGer draftrate_amm1845post c.prewarPOP#1.post c.prewarMF#1.post c.prewarMFGL#1.post c.prewarurb#1.post i.year if year>1890 , a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on id

Number of clusters (id) =         2227                Number of obs =    10353
                                                      F( 11,  2226) =  1.0e+05
                                                      Prob > F      =   0.0000
Total (centered) SS     =   1798.58375                Centered R2   =   0.8582
Total (uncentered) SS   =   1798.58375                Uncentered R2 =   0.8582
Residual SS             =  254.9626277                Root MSE      =     .157

---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0591362   .0322119    -1.84   0.067    -.1223047    .0040324
            prewarGer |   .0150641   .0047588     3.17   0.002     .0057319    .0243963
draftrate_amm1845post |   .0012611   .0011946     1.06   0.291    -.0010816    .0036038
                      |
     post#c.prewarPOP |
                   1  |   1.74e-06   2.99e-07     5.80   0.000     1.15e-06    2.32e-06
                      |
      post#c.prewarMF |
                   1  |  -.0373281   .0177356    -2.10   0.035    -.0721081   -.0025481
                      |
    post#c.prewarMFGL |
                   1  |   .0030782   .0014602     2.11   0.035     .0002147    .0059418
                      |
     post#c.prewarurb |
                   1  |  -.0003798   .0005014    -0.76   0.449     -.001363    .0006034
                      |
                 year |
                1900  |          0  (empty)
                1910  |   .4377784   .0130063    33.66   0.000     .4122726    .4632842
                1920  |   -.729551   .0230288   -31.68   0.000    -.7747112   -.6843908
                1930  |  -.3364964   .0233647   -14.40   0.000    -.3823153   -.2906775
                1940  |  -.2095757   .0237627    -8.82   0.000    -.2561751   -.1629764
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             30.066
                                                   Chi-sq(1) P-val =    0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              215.443
                         (Kleibergen-Paap rk Wald F statistic):         31.437
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         outflow
Included instruments: prewarGer draftrate_amm1845post 1.post#c.prewarPOP
                      1.post#c.prewarMF 1.post#c.prewarMFGL 1.post#c.prewarurb
                      1910.year 1920.year 1930.year 1940.year
Excluded instruments: 5.Q5_casrate_1845amm#1.post
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  31.436508

.         estadd scalar cl = e(df_a_nested)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.02108244

.         estadd local cont1 "Yes"

added macro:
              e(cont1) : "Yes"

.         estadd local cont2 "Yes"

added macro:
              e(cont2) : "Yes"

.         estadd local cont3 "Yes"

added macro:
              e(cont3) : "Yes"

.         est store regB3

.         
.         * PANEL A COLUMN 4: with the above AND time varying population controls
.         ivreghdfe lnwages (outflow= 5.Q5_casrate_1845amm#1.post) prewarGer mtot totpop draftrate_amm1845post c.prewarPOP#1.post c.prewarMF#1.post c.prewarMFGL#1.post c.prewarurb#1.post i.year if year>1890 , a(id) clust
> er(id)
(MWFE estimator converged in 1 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on id

Number of clusters (id) =         2227                Number of obs =    10353
                                                      F( 13,  2226) = 86878.81
                                                      Prob > F      =   0.0000
Total (centered) SS     =   1798.58375                Centered R2   =   0.8584
Total (uncentered) SS   =   1798.58375                Uncentered R2 =   0.8584
Residual SS             =  254.6502997                Root MSE      =    .1569

---------------------------------------------------------------------------------------
                      |               Robust
              lnwages | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0819933    .033836    -2.42   0.015    -.1483468   -.0156398
            prewarGer |   .0188187   .0049998     3.76   0.000     .0090139    .0286235
                 mtot |   .0000171   6.71e-06     2.55   0.011     3.98e-06    .0000303
               totpop |  -6.78e-06   3.34e-06    -2.03   0.043    -.0000133   -2.29e-07
draftrate_amm1845post |   .0001413   .0011158     0.13   0.899    -.0020469    .0023295
                      |
     post#c.prewarPOP |
                   1  |   1.11e-06   3.12e-07     3.56   0.000     4.99e-07    1.72e-06
                      |
      post#c.prewarMF |
                   1  |  -.0416163   .0175946    -2.37   0.018    -.0761198   -.0071127
                      |
    post#c.prewarMFGL |
                   1  |   .0029121   .0014982     1.94   0.052     -.000026    .0058502
                      |
     post#c.prewarurb |
                   1  |  -.0015539   .0006717    -2.31   0.021    -.0028711   -.0002366
                      |
                 year |
                1900  |          0  (empty)
                1910  |   .4402288   .0133619    32.95   0.000     .4140256    .4664319
                1920  |  -.6989405    .023591   -29.63   0.000    -.7452031   -.6526778
                1930  |  -.3105881   .0237125   -13.10   0.000     -.357089   -.2640872
                1940  |  -.1865081   .0239813    -7.78   0.000    -.2335361   -.1394801
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             29.684
                                                   Chi-sq(1) P-val =    0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              212.358
                         (Kleibergen-Paap rk Wald F statistic):         30.968
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         outflow
Included instruments: prewarGer mtot totpop draftrate_amm1845post
                      1.post#c.prewarPOP 1.post#c.prewarMF 1.post#c.prewarMFGL
                      1.post#c.prewarurb 1910.year 1920.year 1930.year 1940.year
Excluded instruments: 5.Q5_casrate_1845amm#1.post
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  30.968086

.         estadd scalar cl = e(df_a_nested)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.02923115

.         estadd local cont1 "Yes"

added macro:
              e(cont1) : "Yes"

.         estadd local cont2 "Yes"

added macro:
              e(cont2) : "Yes"

.         estadd local cont3 "Yes"

added macro:
              e(cont3) : "Yes"

.         estadd local cont4 "Yes"

added macro:
              e(cont4) : "Yes"

.         est store regB4

.         
.         
.         * generate upper panel for the table
.         #delimit ;
delimiter now ;
.         esttab regB* using "$path/Replication/tables/table5_panelA.tex",                        
>                    replace star(* 0.10 ** 0.05 *** 0.01)                                                                
>                    keep(*outflow*)                                                                                                              
>                    coeflabels(outflow "Post-WWI $\times$ German Outflow$\_{1910-20}$")  
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")                                                               
>                    stats(N cl meaneff fF cont1 cont2 cont3 cont4, fmt(%9.0fc %9.0fc %9.3fc %9.3fc %9s %9s %9s %9s)                      
>                    label("\\[-1.5em] \hline Observations"                                                                                               
>                                  "Counties"                     
>                                  "Effect at mean outflow"
>                                  "K-P F-statistic"                                                                                              
>                                  "\\[-1.5em] \hline Pre-war \% Germans and draft rate"                                                                          
>                                  "Pre-war population and sex ratio"                                                                     
>                                  "Pre-war manufacturing and urbanization"                                               
>                                  "Time-varying population"));
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table5_panelA.tex)

.         #delimit cr
delimiter now cr
.         est clear

. 
. 
.         * BOTTOM PANEL
.         ***************************************************************************************************************************************
.         
. 
.         * PANEL B COLUMN 1: log firm size
.         qui ivmediate lnwages $controls if year>1890 & S==1, med(lnfirmsize) treatment(outflow) instrument(IV) a(id) vce(cluster id)

.         scalar medeff = e(mepct)

.         ivreghdfe lnfirmsize (outflow= 5.Q5_casrate_1845amm#1.post) $controls2 if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on id

Number of clusters (id) =         2227                Number of obs =    10353
                                                      F( 13,  2226) =   616.21
                                                      Prob > F      =   0.0000
Total (centered) SS     =  4632.237136                Centered R2   =   0.6399
Total (uncentered) SS   =  4632.237136                Uncentered R2 =   0.6399
Residual SS             =  1668.031105                Root MSE      =    .4017

---------------------------------------------------------------------------------------
                      |               Robust
           lnfirmsize | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.3934312   .1342998    -2.93   0.003    -.6567972   -.1300652
            prewarGer |   .0490816   .0194272     2.53   0.012     .0109842     .087179
                      |
                 year |
                1900  |          0  (empty)
                1910  |   .3513143   .0467765     7.51   0.000     .2595841    .4430445
                1920  |   .9323527   .0859569    10.85   0.000     .7637885    1.100917
                1930  |   1.389189   .0852603    16.29   0.000     1.221991    1.556387
                1940  |   1.475986   .0866043    17.04   0.000     1.306152     1.64582
                      |
draftrate_amm1845post |   .0064023   .0037607     1.70   0.089    -.0009724    .0137771
                      |
     post#c.prewarPOP |
                   1  |   .0000129   1.23e-06    10.48   0.000     .0000105    .0000153
                      |
    post#c.prewarMFGL |
                   1  |   -.012984    .005851    -2.22   0.027     -.024458     -.00151
                      |
      post#c.prewarMF |
                   1  |  -.2078266    .070501    -2.95   0.003    -.3460813   -.0695719
                      |
               totpop |  -.0000663   .0000104    -6.38   0.000    -.0000867   -.0000459
                 mtot |   .0001349   .0000209     6.45   0.000     .0000939    .0001759
                      |
     post#c.prewarurb |
                   1  |   -.004122   .0022797    -1.81   0.071    -.0085927    .0003486
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             29.684
                                                   Chi-sq(1) P-val =    0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              212.358
                         (Kleibergen-Paap rk Wald F statistic):         30.968
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         outflow
Included instruments: prewarGer 1910.year 1920.year 1930.year 1940.year
                      draftrate_amm1845post 1.post#c.prewarPOP
                      1.post#c.prewarMFGL 1.post#c.prewarMF totpop mtot
                      1.post#c.prewarurb
Excluded instruments: 5.Q5_casrate_1845amm#1.post
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  30.968086

.         estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.14026083

.         estadd scalar mediate = medeff

added scalar:
            e(mediate) =  82.802695

.         estadd local cont "Yes"

added macro:
               e(cont) : "Yes"

.         est store regJ1 

.         
.         * PANEL B COLUMN 2: log mfg estabs
.         qui ivmediate lnwages $controls if year>1890 & S==1, med(lnmfgestab) treatment(outflow) instrument(IV) a(id) vce(cluster id)

.         scalar medeff = e(mepct)

.         ivreghdfe lnmfgestab (outflow= 5.Q5_casrate_1845amm#1.post) $controls2 if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on id

Number of clusters (id) =         2227                Number of obs =    10353
                                                      F( 13,  2226) =  1477.28
                                                      Prob > F      =   0.0000
Total (centered) SS     =   4591.98895                Centered R2   =   0.7842
Total (uncentered) SS   =   4591.98895                Uncentered R2 =   0.7842
Residual SS             =  990.7555491                Root MSE      =    .3096

---------------------------------------------------------------------------------------
                      |               Robust
           lnmfgestab | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.0404298     .08752    -0.46   0.644    -.2120591    .1311995
            prewarGer |   .0094917    .012802     0.74   0.459    -.0156134    .0345968
                      |
                 year |
                1900  |          0  (empty)
                1910  |   .1199356   .0327144     3.67   0.000     .0557815    .1840896
                1920  |  -.8665137   .0605548   -14.31   0.000    -.9852635   -.7477638
                1930  |  -1.417276   .0607494   -23.33   0.000    -1.536407   -1.298145
                1940  |  -1.624927   .0602335   -26.98   0.000    -1.743047   -1.506808
                      |
draftrate_amm1845post |   .0055524   .0026363     2.11   0.035     .0003826    .0107223
                      |
     post#c.prewarPOP |
                   1  |  -.0000117   9.18e-07   -12.73   0.000    -.0000135   -9.89e-06
                      |
    post#c.prewarMFGL |
                   1  |   .0302413   .0042112     7.18   0.000      .021983    .0384995
                      |
      post#c.prewarMF |
                   1  |   .2320606   .0482793     4.81   0.000     .1373834    .3267378
                      |
               totpop |   5.13e-06   8.04e-06     0.64   0.524    -.0000106    .0000209
                 mtot |   9.28e-06   .0000161     0.58   0.564    -.0000223    .0000408
                      |
     post#c.prewarurb |
                   1  |   .0015997   .0018743     0.85   0.394     -.002076    .0052753
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             29.684
                                                   Chi-sq(1) P-val =    0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              212.358
                         (Kleibergen-Paap rk Wald F statistic):         30.968
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         outflow
Included instruments: prewarGer 1910.year 1920.year 1930.year 1940.year
                      draftrate_amm1845post 1.post#c.prewarPOP
                      1.post#c.prewarMFGL 1.post#c.prewarMF totpop mtot
                      1.post#c.prewarurb
Excluded instruments: 5.Q5_casrate_1845amm#1.post
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  30.968086

.         estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.01441349

.         estadd scalar mediate = medeff

added scalar:
            e(mediate) =  50.55505

.         estadd local cont "Yes"

added macro:
               e(cont) : "Yes"

.         est store regJ2

.         
.         * PANEL B COLUMN 3: log mfg labor
.         qui ivmediate lnwages $controls if year>1890 & S==1, med(lnmfglaborpc) treatment(outflow) instrument(IV) a(id) vce(cluster id)

.         scalar medeff = e(mepct)

.         ivreghdfe lnmfglaborpc (outflow= 5.Q5_casrate_1845amm#1.post) $controls2 if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on id

Number of clusters (id) =         2227                Number of obs =    10353
                                                      F( 13,  2226) =   188.10
                                                      Prob > F      =   0.0000
Total (centered) SS     =  2603.114469                Centered R2   =   0.0541
Total (uncentered) SS   =  2603.114469                Uncentered R2 =   0.0541
Residual SS             =  2462.298751                Root MSE      =     .488

---------------------------------------------------------------------------------------
                      |               Robust
         lnmfglaborpc | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.3015883   .1432378    -2.11   0.035    -.5824819   -.0206947
            prewarGer |   .0442487   .0206351     2.14   0.032     .0037826    .0847147
                      |
                 year |
                1900  |          0  (empty)
                1910  |   .4323378   .0507865     8.51   0.000     .3327439    .5319317
                1920  |   .3669439   .0915713     4.01   0.000     .1873699    .5465179
                1930  |   .2965578   .0914513     3.24   0.001     .1172191    .4758966
                1940  |   .1252964   .0930098     1.35   0.178    -.0570985    .3076914
                      |
draftrate_amm1845post |   .0035331   .0035358     1.00   0.318    -.0034008     .010467
                      |
     post#c.prewarPOP |
                   1  |   6.17e-06   1.18e-06     5.23   0.000     3.86e-06    8.49e-06
                      |
    post#c.prewarMFGL |
                   1  |   -.014872   .0054514    -2.73   0.006    -.0255623   -.0041816
                      |
      post#c.prewarMF |
                   1  |  -.1616407   .0736549    -2.19   0.028    -.3060802   -.0172012
                      |
               totpop |  -.0000409   9.14e-06    -4.47   0.000    -.0000588    -.000023
                 mtot |   .0000821   .0000183     4.48   0.000     .0000461    .0001181
                      |
     post#c.prewarurb |
                   1  |  -.0020049   .0019653    -1.02   0.308    -.0058589    .0018492
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             29.684
                                                   Chi-sq(1) P-val =    0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              212.358
                         (Kleibergen-Paap rk Wald F statistic):         30.968
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         outflow
Included instruments: prewarGer 1910.year 1920.year 1930.year 1940.year
                      draftrate_amm1845post 1.post#c.prewarPOP
                      1.post#c.prewarMFGL 1.post#c.prewarMF totpop mtot
                      1.post#c.prewarurb
Excluded instruments: 5.Q5_casrate_1845amm#1.post
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  30.968086

.         estadd scalar cl = e(df_a_nested)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.10751823

.         estadd scalar mediate = medeff

added scalar:
            e(mediate) =  85.210829

.         estadd local cont "Yes"

added macro:
               e(cont) : "Yes"

.         est store regJ3

.         
.         * PANEL B COLUMN 4: log output per capita
.         qui ivmediate lnwages $controls if year>1890 & S==1, med(lnmfgoutpc) treatment(outflow) instrument(IV) a(id) vce(cluster id)

.         scalar medeff = e(mepct)

.         ivreghdfe lnmfgoutpc (outflow= 5.quincas#1.post) $controls2 if year>1890 & S==1, a(id) cluster(id)
(MWFE estimator converged in 1 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on id

Number of clusters (id) =         2227                Number of obs =    10353
                                                      F( 13,  2226) =  5525.71
                                                      Prob > F      =   0.0000
Total (centered) SS     =  19014.20705                Centered R2   =   0.8618
Total (uncentered) SS   =  19014.20705                Uncentered R2 =   0.8618
Residual SS             =  2628.135304                Root MSE      =    .5042

---------------------------------------------------------------------------------------
                      |               Robust
           lnmfgoutpc | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------+----------------------------------------------------------------
              outflow |  -.2992383   .1645416    -1.82   0.069    -.6219095    .0234328
            prewarGer |   .0812547   .0240978     3.37   0.001     .0339982    .1285112
                      |
                 year |
                1900  |          0  (empty)
                1910  |  -2.678013   .0594383   -45.06   0.000    -2.794574   -2.561453
                1920  |  -.1207597   .0921554    -1.31   0.190    -.3014792    .0599598
                1930  |  -.0174505   .0927864    -0.19   0.851    -.1994074    .1645064
                1940  |  -.0896742   .0934129    -0.96   0.337    -.2728598    .0935114
                      |
draftrate_amm1845post |   .0071558   .0044714     1.60   0.110    -.0016126    .0159243
                      |
     post#c.prewarPOP |
                   1  |   .0000144   1.37e-06    10.56   0.000     .0000117    .0000171
                      |
    post#c.prewarMFGL |
                   1  |     .04132   .0067074     6.16   0.000     .0281665    .0544734
                      |
      post#c.prewarMF |
                   1  |  -.0068726   .0724914    -0.09   0.924    -.1490305    .1352853
                      |
               totpop |  -3.66e-07   7.77e-06    -0.05   0.962    -.0000156    .0000149
                 mtot |   3.81e-06   .0000153     0.25   0.804    -.0000262    .0000338
                      |
     post#c.prewarurb |
                   1  |  -.0086973   .0024667    -3.53   0.000    -.0135346   -.0038599
---------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             28.452
                                                   Chi-sq(1) P-val =    0.0000
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):              188.470
                         (Kleibergen-Paap rk Wald F statistic):         29.603
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Hansen J statistic (overidentification test of all instruments):         0.000
                                                 (equation exactly identified)
------------------------------------------------------------------------------
Instrumented:         outflow
Included instruments: prewarGer 1910.year 1920.year 1930.year 1940.year
                      draftrate_amm1845post 1.post#c.prewarPOP
                      1.post#c.prewarMFGL 1.post#c.prewarMF totpop mtot
                      1.post#c.prewarurb
Excluded instruments: 5.quincas#1.post
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
          id |      2227        2227           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

.         estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  29.603322

.         estadd scalar cl = e(df_a_nested)

added scalar:
                 e(cl) =  2227

.         estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.10668045

.         estadd scalar mediate = medeff

added scalar:
            e(mediate) =  80.441878

.         estadd local cont "Yes"

added macro:
               e(cont) : "Yes"

.         est store regJ4

.         
.         
.         * generate lower panel for the table
.         #delimit ;
delimiter now ;
.         esttab regJ* using "$path/Replication/tables/table5_panelB.tex",
>                    replace star(* 0.10 ** 0.05 *** 0.01)
>                    keep(*outflow*)
>                    coeflabels(outflow "Post-WWI $\times$ German Outflow$\_{1910-20}$")
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")
>                    stats(N cl meaneff mediate fF cont, fmt(%9.0fc %9.0fc %9.3fc %9.3fc %9.3fc %9s)
>                    label("\\[-1.5em] \hline Observations"
>                                  "Counties"
>                                  "Effect at mean outflow"
>                                  "Causal mediation effect (\%)"
>                                  "K-P F-statistic"
>                                  "\\[-1.5em] \hline Controls"));
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table5_panelB.tex)

.         #delimit cr
delimiter now cr
.         est clear

.         
.         
.         
. *******************************************************************************************************************************************
. * TABLE 6
. *******************************************************************************************************************************************
. use "$path/Replication/cleaned_data/linked_Americans_estimation_sample.dta", clear

. 
.         global controls "c.draftrate i.urban1910 i.skill1910 i.farm1910 i.empstat1910 i.lit1910 i.marst1910 c.famsize1910 i.school1910 i.labforce1910 c.wksunemp1910"

. 
.         scalar meanout = .35

. 
. 
.         * TOP PANEL
.         *************************************************************************************************************************************** 
. 
.         * PANEL A COLUMN 1: log occ score
.         reghdfe lnoccscore outflow $controls if abe_nysiis_standard==1 & maxmover==0, a(fips birthyr bpl year) cluster(fips)
note: 2bn.labforce1910 is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 25 iterations)
note: 10.skill1910 omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 2.labforce1910 omitted because of collinearity

HDFE Linear regression                            Number of obs   =    640,333
Absorbing 4 HDFE groups                           F(  23,   2156) =    1908.88
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.2867
                                                  Adj R-squared   =     0.2842
                                                  Within R-sq.    =     0.1589
Number of clusters (fips)    =      2,157         Root MSE        =     0.5211

                                                    (Std. err. adjusted for 2,157 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                       lnoccscore | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |  -.0140223   .0035676    -3.93   0.000    -.0210185    -.007026
                        draftrate |  -.0013455   .0007712    -1.74   0.081    -.0028579     .000167
                      2.urban1910 |   .0162922   .0035246     4.62   0.000     .0093802    .0232043
                                  |
                        skill1910 |
         Professional, Technical  |   .7171928   .0064552   111.10   0.000     .7045337    .7298518
Managers, Officials, Proprietors  |   .4193925   .0045598    91.98   0.000     .4104504    .4283346
            Clerical and Kindred  |   .2943839   .0060554    48.61   0.000     .2825088     .306259
                   Sales workers  |   .2695693   .0050646    53.23   0.000     .2596373    .2795014
                       Craftsmen  |    .194322   .0036219    53.65   0.000     .1872192    .2014248
                      Operatives  |   .1516656   .0044433    34.13   0.000      .142952    .1603792
   Service Workers (priv househ)  |  -.0145068   .0050945    -2.85   0.004    -.0244976   -.0045161
                   Farm Laborers  |  -.3858811   .0054223   -71.17   0.000    -.3965146   -.3752476
                        Laborers  |          0  (omitted)
                                  |
                       2.farm1910 |  -.1343831   .0038531   -34.88   0.000    -.1419393   -.1268268
                                  |
                      empstat1910 |
                               1  |   .0228558   .0041908     5.45   0.000     .0146373    .0310743
                               2  |          0  (omitted)
                                  |
                          lit1910 |
                               2  |   .6688458   .0086162    77.63   0.000     .6519488    .6857428
                               3  |   .0257891   .0136709     1.89   0.059    -.0010204    .0525985
                               4  |   .1623309   .0078325    20.73   0.000      .146971    .1776909
                                  |
                        marst1910 |
                               1  |   -.063709   .0027103   -23.51   0.000    -.0690241    -.058394
                               2  |  -.0719243   .0074629    -9.64   0.000    -.0865595   -.0572892
                               4  |  -.1551016   .0127853   -12.13   0.000    -.1801743   -.1300289
                               5  |  -.1422817   .0070598   -20.15   0.000    -.1561265   -.1284369
                                  |
                      famsize1910 |    -.00379   .0004393    -8.63   0.000    -.0046515   -.0029284
                     2.school1910 |   .0240019    .005635     4.26   0.000     .0129514    .0350524
                   2.labforce1910 |          0  (omitted)
                     wksunemp1910 |   .0001937   .0000249     7.78   0.000     .0001448    .0002425
                            _cons |   3.037543   .0072404   419.53   0.000     3.023344    3.051741
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su lnoccscore if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  3.1424993

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .28418757

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.0049078

.                 est store regA1

. 
.         * PANEL A COLUMN 2: 
.         reghdfe lnlido outflow $controls if abe_nysiis_standard==1 & maxmover==0, a(fips birthyr bpl year) cluster(fips)
note: 2bn.labforce1910 is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 25 iterations)
note: 10.skill1910 omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 2.labforce1910 omitted because of collinearity

HDFE Linear regression                            Number of obs   =    640,333
Absorbing 4 HDFE groups                           F(  23,   2156) =    1288.01
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.3180
                                                  Adj R-squared   =     0.3155
                                                  Within R-sq.    =     0.1551
Number of clusters (fips)    =      2,157         Root MSE        =     0.4104

                                                    (Std. err. adjusted for 2,157 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                           lnlido | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |  -.0073631    .002048    -3.60   0.000    -.0113793   -.0033468
                        draftrate |  -.0003634    .000366    -0.99   0.321    -.0010811    .0003543
                      2.urban1910 |   .0433277   .0030404    14.25   0.000     .0373653      .04929
                                  |
                        skill1910 |
         Professional, Technical  |   .6001258   .0062929    95.37   0.000      .587785    .6124666
Managers, Officials, Proprietors  |   .3081128   .0046166    66.74   0.000     .2990594    .3171662
            Clerical and Kindred  |   .2861993   .0055004    52.03   0.000     .2754128    .2969859
                   Sales workers  |   .2124756   .0044664    47.57   0.000     .2037167    .2212346
                       Craftsmen  |   .1108769   .0032375    34.25   0.000     .1045279    .1172258
                      Operatives  |   .0925651   .0048334    19.15   0.000     .0830865    .1020437
   Service Workers (priv househ)  |   .0120877   .0047756     2.53   0.011     .0027224    .0214531
                   Farm Laborers  |   -.283121   .0047165   -60.03   0.000    -.2923703   -.2738717
                        Laborers  |          0  (omitted)
                                  |
                       2.farm1910 |    -.07664   .0028838   -26.58   0.000    -.0822954   -.0709846
                                  |
                      empstat1910 |
                               1  |   .0368991   .0036379    10.14   0.000     .0297651    .0440332
                               2  |          0  (omitted)
                                  |
                          lit1910 |
                               2  |   .4908534   .0077122    63.65   0.000     .4757292    .5059776
                               3  |   .0367531   .0112565     3.27   0.001     .0146784    .0588278
                               4  |   .1874929   .0071477    26.23   0.000     .1734758    .2015099
                                  |
                        marst1910 |
                               1  |  -.0227322   .0020391   -11.15   0.000     -.026731   -.0187333
                               2  |  -.0439147   .0060157    -7.30   0.000    -.0557119   -.0321176
                               4  |  -.1134669   .0107308   -10.57   0.000    -.1345108    -.092423
                               5  |  -.1028737   .0061529   -16.72   0.000      -.11494   -.0908075
                                  |
                      famsize1910 |  -.0023586   .0003281    -7.19   0.000    -.0030019   -.0017152
                     2.school1910 |   .0222549   .0040837     5.45   0.000     .0142465    .0302633
                   2.labforce1910 |          0  (omitted)
                     wksunemp1910 |  -.0000975   .0000194    -5.01   0.000    -.0001357   -.0000594
                            _cons |   2.931562   .0051111   573.57   0.000     2.921539    2.941585
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su lnlido if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  3.0754403

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .3155387

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.00257707

.                 est store regA2

. 
.         * PANEL A COLUMN 3: manufacturing worker
.         reghdfe mfg outflow $controls if abe_nysiis_standard==1 & maxmover==0, a(fips birthyr bpl year) cluster(fips)
note: 2bn.labforce1910 is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 25 iterations)
note: 10.skill1910 omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 2.labforce1910 omitted because of collinearity

HDFE Linear regression                            Number of obs   =    640,333
Absorbing 4 HDFE groups                           F(  23,   2156) =    1882.03
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.1278
                                                  Adj R-squared   =     0.1246
                                                  Within R-sq.    =     0.0340
Number of clusters (fips)    =      2,157         Root MSE        =     0.3592

                                                    (Std. err. adjusted for 2,157 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                              mfg | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |  -.0011709   .0017367    -0.67   0.500    -.0045767    .0022349
                        draftrate |  -.0004859   .0003551    -1.37   0.171    -.0011823    .0002106
                      2.urban1910 |   .0503093   .0044821    11.22   0.000     .0415196    .0590989
                                  |
                        skill1910 |
         Professional, Technical  |   -.230348   .0056151   -41.02   0.000    -.2413597   -.2193364
Managers, Officials, Proprietors  |  -.1949971   .0051226   -38.07   0.000     -.205043   -.1849513
            Clerical and Kindred  |  -.1936261   .0055039   -35.18   0.000    -.2044196   -.1828327
                   Sales workers  |  -.2334828   .0054612   -42.75   0.000    -.2441926    -.222773
                       Craftsmen  |  -.0818929    .004384   -18.68   0.000    -.0904903   -.0732956
                      Operatives  |  -.0153664   .0084544    -1.82   0.069     -.031946    .0012132
   Service Workers (priv househ)  |   -.203774    .005726   -35.59   0.000    -.2150031   -.1925449
                   Farm Laborers  |  -.1508091   .0042779   -35.25   0.000    -.1591983   -.1424199
                        Laborers  |          0  (omitted)
                                  |
                       2.farm1910 |  -.0346473   .0023812   -14.55   0.000     -.039317   -.0299777
                                  |
                      empstat1910 |
                               1  |   .0334541   .0053621     6.24   0.000     .0229387    .0439695
                               2  |          0  (omitted)
                                  |
                          lit1910 |
                               2  |   .4149851   .0060684    68.38   0.000     .4030845    .4268857
                               3  |   .0093858   .0101924     0.92   0.357    -.0106022    .0293739
                               4  |  -.0126045    .006432    -1.96   0.050     -.025218    9.09e-06
                                  |
                        marst1910 |
                               1  |   .0085799   .0018712     4.59   0.000     .0049104    .0122495
                               2  |   .0188391   .0060001     3.14   0.002     .0070725    .0306058
                               4  |  -.0089779   .0096409    -0.93   0.352    -.0278844    .0099286
                               5  |   .0105789   .0052503     2.01   0.044     .0002826    .0208751
                                  |
                      famsize1910 |   .0018061   .0003239     5.58   0.000     .0011709    .0024414
                     2.school1910 |  -.0185767   .0029393    -6.32   0.000    -.0243409   -.0128125
                   2.labforce1910 |          0  (omitted)
                     wksunemp1910 |  -.0003647    .000021   -17.40   0.000    -.0004058   -.0003236
                            _cons |   .2315265   .0055006    42.09   0.000     .2207394    .2423135
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su mfg if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .17972368

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .12464903

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.00040981

.                 est store regA3

. 
.         * PANEL A COLUMN 4: managerial job
.         reghdfe mgr outflow $controls if abe_nysiis_standard==1 & maxmover==0 , a(fips birthyr bpl year) cluster(fips)
note: 2bn.labforce1910 is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 25 iterations)
note: 10.skill1910 omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 2.labforce1910 omitted because of collinearity

HDFE Linear regression                            Number of obs   =    640,333
Absorbing 4 HDFE groups                           F(  23,   2156) =    5650.25
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.2628
                                                  Adj R-squared   =     0.2602
                                                  Within R-sq.    =     0.2043
Number of clusters (fips)    =      2,157         Root MSE        =     0.3476

                                                    (Std. err. adjusted for 2,157 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                              mgr | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |   .0008863    .001387     0.64   0.523    -.0018336    .0036062
                        draftrate |   .0005166   .0002658     1.94   0.052    -4.56e-06    .0010378
                      2.urban1910 |   .0076528   .0017376     4.40   0.000     .0042453    .0110604
                                  |
                        skill1910 |
         Professional, Technical  |    .770963   .0031743   242.88   0.000      .764738    .7771879
Managers, Officials, Proprietors  |   .5901503   .0032439   181.93   0.000     .5837888    .5965118
            Clerical and Kindred  |   .1564821   .0035052    44.64   0.000     .1496081    .1633561
                   Sales workers  |   .2155485   .0037858    56.94   0.000     .2081243    .2229727
                       Craftsmen  |    .006701   .0018105     3.70   0.000     .0031505    .0102516
                      Operatives  |   .0442487   .0023551    18.79   0.000     .0396303    .0488671
   Service Workers (priv househ)  |   .0118039   .0033449     3.53   0.000     .0052444    .0183634
                   Farm Laborers  |  -.0022469   .0018583    -1.21   0.227    -.0058912    .0013973
                        Laborers  |          0  (omitted)
                                  |
                       2.farm1910 |  -.0114775   .0017588    -6.53   0.000    -.0149266   -.0080285
                                  |
                      empstat1910 |
                               1  |   .0198396   .0026188     7.58   0.000      .014704    .0249752
                               2  |          0  (omitted)
                                  |
                          lit1910 |
                               2  |    .014468   .0028783     5.03   0.000     .0088235    .0201124
                               3  |   .0020364   .0048106     0.42   0.672    -.0073974    .0114703
                               4  |   .0575782   .0022892    25.15   0.000     .0530889    .0620674
                                  |
                        marst1910 |
                               1  |  -.0488559   .0016247   -30.07   0.000     -.052042   -.0456699
                               2  |  -.0488964   .0048939    -9.99   0.000    -.0584937   -.0392992
                               4  |    -.07246   .0089387    -8.11   0.000    -.0899894   -.0549306
                               5  |  -.0778893   .0044104   -17.66   0.000    -.0865383   -.0692403
                                  |
                      famsize1910 |  -.0028218   .0002345   -12.03   0.000    -.0032818   -.0023618
                     2.school1910 |   .0452379    .002821    16.04   0.000     .0397058    .0507701
                   2.labforce1910 |          0  (omitted)
                     wksunemp1910 |   .0002239   .0000154    14.57   0.000     .0001937     .000254
                            _cons |   .0992792   .0028357    35.01   0.000     .0937181    .1048402
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su mgr if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .20555399

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .26015733

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  .00031021

.                 est store regA4

.                 
.         * PANEL A COLUMN 5: craftsmen job
.         reghdfe craft outflow $controls if abe_nysiis_standard==1 & maxmover==0 , a(fips birthyr bpl year) cluster(fips)
note: 2bn.labforce1910 is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 25 iterations)
note: 10.skill1910 omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 2.labforce1910 omitted because of collinearity

HDFE Linear regression                            Number of obs   =    640,333
Absorbing 4 HDFE groups                           F(  23,   2156) =    3848.34
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.2181
                                                  Adj R-squared   =     0.2153
                                                  Within R-sq.    =     0.1849
Number of clusters (fips)    =      2,157         Root MSE        =     0.3873

                                                    (Std. err. adjusted for 2,157 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                            craft | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |  -.0094754   .0016755    -5.66   0.000    -.0127611   -.0061897
                        draftrate |   -.000811   .0003344    -2.43   0.015    -.0014667   -.0001552
                      2.urban1910 |   .0030747    .002391     1.29   0.199    -.0016142    .0077635
                                  |
                        skill1910 |
         Professional, Technical  |  -.1933358   .0037801   -51.15   0.000    -.2007488   -.1859228
Managers, Officials, Proprietors  |  -.1381185   .0038538   -35.84   0.000     -.145676   -.1305609
            Clerical and Kindred  |  -.1556827   .0039884   -39.03   0.000    -.1635043   -.1478611
                   Sales workers  |  -.1386648   .0039029   -35.53   0.000    -.1463186    -.131011
                       Craftsmen  |   .4982701   .0038987   127.81   0.000     .4906246    .5059157
                      Operatives  |  -.0335044   .0039736    -8.43   0.000    -.0412969   -.0257119
   Service Workers (priv househ)  |  -.1216582    .004647   -26.18   0.000    -.1307713    -.112545
                   Farm Laborers  |  -.0812817   .0035465   -22.92   0.000    -.0882366   -.0743268
                        Laborers  |          0  (omitted)
                                  |
                       2.farm1910 |  -.0149384   .0022099    -6.76   0.000    -.0192722   -.0106046
                                  |
                      empstat1910 |
                               1  |    .015841   .0040344     3.93   0.000     .0079293    .0237526
                               2  |          0  (omitted)
                                  |
                          lit1910 |
                               2  |   .0243558   .0041381     5.89   0.000     .0162408    .0324709
                               3  |   .0120437   .0074852     1.61   0.108    -.0026352    .0267226
                               4  |   .0780545   .0039062    19.98   0.000     .0703941    .0857149
                                  |
                        marst1910 |
                               1  |  -.0184705   .0017219   -10.73   0.000    -.0218472   -.0150937
                               2  |  -.0142525   .0060261    -2.37   0.018    -.0260702   -.0024349
                               4  |   -.060137   .0100312    -6.00   0.000    -.0798087   -.0404652
                               5  |   -.036733   .0051452    -7.14   0.000    -.0468231    -.026643
                                  |
                      famsize1910 |   .0010843   .0002879     3.77   0.000     .0005196    .0016489
                     2.school1910 |  -.0163046   .0030075    -5.42   0.000    -.0222024   -.0104067
                   2.labforce1910 |          0  (omitted)
                     wksunemp1910 |  -.0000911    .000016    -5.70   0.000    -.0001225   -.0000597
                            _cons |    .197882   .0040115    49.33   0.000     .1900151    .2057488
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su craft if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .25733954

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .21529334

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.00331638

.                 est store regA5

.                 
.         * PANEL A COLUMN 6: operatives job
.         reghdfe op outflow $controls if abe_nysiis_standard==1 & maxmover==0 , a(fips birthyr bpl year) cluster(fips)
note: 2bn.labforce1910 is probably collinear with the fixed effects (all partialled-out values are close to zero; tol = 1.0e-09)
(MWFE estimator converged in 25 iterations)
note: 10.skill1910 omitted because of collinearity
note: 2.empstat1910 omitted because of collinearity
note: 2.labforce1910 omitted because of collinearity

HDFE Linear regression                            Number of obs   =    640,333
Absorbing 4 HDFE groups                           F(  23,   2156) =    3090.43
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.1934
                                                  Adj R-squared   =     0.1905
                                                  Within R-sq.    =     0.0931
Number of clusters (fips)    =      2,157         Root MSE        =     0.3101

                                                    (Std. err. adjusted for 2,157 clusters in fips)
---------------------------------------------------------------------------------------------------
                                  |               Robust
                               op | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |   .0026055   .0016828     1.55   0.122    -.0006947    .0059057
                        draftrate |  -.0005569   .0004257    -1.31   0.191    -.0013917    .0002778
                      2.urban1910 |  -.0153211   .0031414    -4.88   0.000    -.0214817   -.0091605
                                  |
                        skill1910 |
         Professional, Technical  |  -.1401191   .0034974   -40.06   0.000    -.1469777   -.1332605
Managers, Officials, Proprietors  |  -.1095497   .0032997   -33.20   0.000    -.1160206   -.1030788
            Clerical and Kindred  |   -.125178   .0034821   -35.95   0.000    -.1320066   -.1183493
                   Sales workers  |  -.1073664   .0034964   -30.71   0.000    -.1142229   -.1005098
                       Craftsmen  |  -.1076108   .0031765   -33.88   0.000      -.11384   -.1013815
                      Operatives  |   .2878225   .0059075    48.72   0.000     .2762375    .2994076
   Service Workers (priv househ)  |  -.0963424   .0038485   -25.03   0.000    -.1038895   -.0887953
                   Farm Laborers  |  -.0781566   .0031518   -24.80   0.000    -.0843376   -.0719756
                        Laborers  |          0  (omitted)
                                  |
                       2.farm1910 |  -.0126546   .0019883    -6.36   0.000    -.0165539   -.0087553
                                  |
                      empstat1910 |
                               1  |  -.0384915   .0055095    -6.99   0.000    -.0492959   -.0276871
                               2  |          0  (omitted)
                                  |
                          lit1910 |
                               2  |   .4559692   .0056249    81.06   0.000     .4449384        .467
                               3  |   .0055992   .0096375     0.58   0.561    -.0133005    .0244989
                               4  |  -.0183864   .0056794    -3.24   0.001     -.029524   -.0072488
                                  |
                        marst1910 |
                               1  |   .0198036   .0014942    13.25   0.000     .0168733    .0227338
                               2  |   .0176361   .0051113     3.45   0.001     .0076124    .0276598
                               4  |   .0187077   .0088663     2.11   0.035     .0013203    .0360951
                               5  |   .0220788    .003998     5.52   0.000     .0142385     .029919
                                  |
                      famsize1910 |   .0020316   .0002673     7.60   0.000     .0015074    .0025558
                     2.school1910 |  -.0133335   .0026144    -5.10   0.000    -.0184604   -.0082066
                   2.labforce1910 |          0  (omitted)
                     wksunemp1910 |  -.0000692   .0000141    -4.89   0.000     -.000097   -.0000415
                            _cons |   .1876259    .005372    34.93   0.000      .177091    .1981608
---------------------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su op if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .13776113

.                 estadd scalar R2 = e(r2_a)

added scalar:
                 e(R2) =  .19050294

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  .00091193

.                 est store regA6

. 
. 
.         * generate top panel for the table
.         #delimit ;
delimiter now ;
.         esttab regA* using "$path/Replication/tables/table6_panelA.tex",
>                    replace star(* 0.10 ** 0.05 *** 0.01)
>                    keep(outflow)
>                    coeflabels(outflow "Post-WWI $\times$ German Outflow$\_{1910-20}$")
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")
>                    stats(N ymean meaneff R2, fmt(%9.0fc %9.3fc %9.3fc %9.3fc)                           
>                    label("\\[-1em] \hline Observations"                                                                                                         
>                                          "Outcome mean"                                                                                                                 
>                                          "Effect at mean outflow"
>                                          "Adj.\ R$^2$"));
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table6_panelA.tex)

.         #delimit cr
delimiter now cr
.         est clear       

. 
. 
.         * BOTTOM PANEL
.         ***************************************************************************************************************************************
. 
.         * PANEL B COLUMN 1: log firm size
.         ivreghdfe lnoccscore (outflow = treat) $controls if abe_nysiis_standard==1 & maxmover==0, a(fips birthyr bpl year) cluster(fips)
Warning - collinearities detected
Vars dropped:       2.empstat1910 2.labforce1910
(MWFE estimator converged in 25 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on fips

Number of clusters (fips) =       2157                Number of obs =   640333
                                                      F( 23,  2156) = 61388.29
                                                      Prob > F      =   0.0000
Total (centered) SS     =  205991.5153                Centered R2   =   0.1571
Total (uncentered) SS   =  205991.5153                Uncentered R2 =   0.1571
Residual SS             =  173634.9296                Root MSE      =    .5208

---------------------------------------------------------------------------------------------------
                                  |               Robust
                       lnoccscore | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |  -.0679609   .0377153    -1.80   0.072    -.1419231    .0060012
                        draftrate |   .0007532   .0014859     0.51   0.612    -.0021607    .0036672
                                  |
                        urban1910 |
                               0  |          0  (empty)
                               2  |   .0236301   .0062398     3.79   0.000     .0113935    .0358668
                                  |
                        skill1910 |
                               0  |          0  (empty)
         Professional, Technical  |   .7284668   .0388261    18.76   0.000     .6523263    .8046074
Managers, Officials, Proprietors  |   .4320151   .0383747    11.26   0.000     .3567598    .5072704
            Clerical and Kindred  |   .3069691   .0391664     7.84   0.000     .2301613     .383777
                   Sales workers  |   .2807406   .0387871     7.24   0.000     .2046767    .3568046
                       Craftsmen  |    .207329   .0371464     5.58   0.000     .1344826    .2801755
                      Operatives  |   .1621302   .0394878     4.11   0.000     .0846921    .2395683
   Service Workers (priv househ)  |          0   .0375511     0.00   1.000    -.0736402    .0736402
                   Farm Laborers  |  -.3724222   .0355798   -10.47   0.000    -.4421966   -.3026478
                        Laborers  |   .0127619   .0385819     0.33   0.741    -.0628998    .0884236
                                  |
                         farm1910 |
                               0  |          0  (empty)
                               2  |  -.1341092   .0038597   -34.75   0.000    -.1416783   -.1265402
                                  |
                      empstat1910 |
                               0  |          0  (empty)
                               1  |   .0242235   .0042818     5.66   0.000     .0158265    .0326204
                               2  |          0  (empty)
                                  |
                          lit1910 |
                               0  |          0  (empty)
                               2  |   .6655181   .0088906    74.86   0.000     .6480831    .6829531
                               3  |   .0268289   .0137095     1.96   0.050    -.0000563    .0537142
                               4  |    .169219   .0090462    18.71   0.000     .1514788    .1869592
                                  |
                        marst1910 |
                               0  |          0  (empty)
                               1  |  -.0665928   .0033958   -19.61   0.000    -.0732521   -.0599335
                               2  |  -.0764483   .0082224    -9.30   0.000     -.092573   -.0603236
                               4  |  -.1580187    .012904   -12.25   0.000    -.1833243    -.132713
                               5  |  -.1466838   .0074518   -19.68   0.000    -.1612973   -.1320702
                                  |
                      famsize1910 |  -.0036859   .0004444    -8.29   0.000    -.0045574   -.0028143
                                  |
                       school1910 |
                               0  |          0  (empty)
                               2  |   .0193491   .0065335     2.96   0.003     .0065366    .0321617
                                  |
                     labforce1910 |
                               0  |          0  (empty)
                               2  |          0  (empty)
                                  |
                     wksunemp1910 |   .0001897    .000025     7.58   0.000     .0001406    .0002388
---------------------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             10.078
                                                   Chi-sq(1) P-val =    0.0015
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):             9708.215
                         (Kleibergen-Paap rk Wald F statistic):         10.246
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Warning: estimated covariance matrix of moment conditions not of full rank.
         overidentification statistic not reported, and standard errors and
         model tests should be interpreted with caution.
Possible causes:
         number of clusters insufficient to calculate robust covariance matrix
         singleton dummy variable (dummy with one 1 and N-1 0s or vice versa)
partial option may address problem.
------------------------------------------------------------------------------
Collinearities detected among instruments: 1 instrument(s) dropped
Instrumented:         outflow
Included instruments: draftrate 2.urban1910 1.skill1910 3.skill1910 4.skill1910
                      5.skill1910 6.skill1910 7.skill1910 8.skill1910
                      9.skill1910 10.skill1910 2.farm1910 1.empstat1910
                      2.lit1910 3.lit1910 4.lit1910 1.marst1910 2.marst1910
                      4.marst1910 5.marst1910 famsize1910 2.school1910
                      wksunemp1910
Excluded instruments: treat
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
Dropped collinear:    2.empstat1910 2.labforce1910
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su lnoccscore if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  3.1424993

.                 estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  10.246255

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.02378633

.                 est store regA1

. 
.         * PANEL B COLUMN 2: 
.         ivreghdfe lnlido (outflow = treat) $controls if abe_nysiis_standard==1 & maxmover==0, a(fips birthyr bpl year) cluster(fips)
Warning - collinearities detected
Vars dropped:       2.empstat1910 2.labforce1910
(MWFE estimator converged in 25 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on fips

Number of clusters (fips) =       2157                Number of obs =   640333
                                                      F( 23,  2156) =  1902.40
                                                      Prob > F      =   0.0000
Total (centered) SS     =  127231.1761                Centered R2   =   0.1545
Total (uncentered) SS   =  127231.1761                Uncentered R2 =   0.1545
Residual SS             =  107572.4238                Root MSE      =    .4099

---------------------------------------------------------------------------------------------------
                                  |               Robust
                           lnlido | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |  -.0319362   .0238514    -1.34   0.181    -.0787104     .014838
                        draftrate |   .0005927   .0009355     0.63   0.526    -.0012419    .0024273
                                  |
                        urban1910 |
                               0  |          0  (empty)
                               2  |   .0466706   .0043314    10.77   0.000     .0381764    .0551648
                                  |
                        skill1910 |
                               0  |          0  (empty)
         Professional, Technical  |   .5865653   .0042191   139.03   0.000     .5782913    .5948392
Managers, Officials, Proprietors  |   .2951667   .0036568    80.72   0.000     .2879954     .302338
            Clerical and Kindred  |   .2732361          .        .       .            .           .
                   Sales workers  |   .1988683   .0035595    55.87   0.000     .1918878    .2058488
                       Craftsmen  |   .0981058   .0045455    21.58   0.000     .0891918    .1070199
                      Operatives  |   .0786358   .0049773    15.80   0.000      .068875    .0883966
   Service Workers (priv househ)  |          0    .004628     0.00   1.000    -.0090759    .0090759
                   Farm Laborers  |  -.2956862   .0060895   -48.56   0.000    -.3076281   -.2837442
                        Laborers  |  -.0128827   .0054746    -2.35   0.019    -.0236187   -.0021467
                                  |
                         farm1910 |
                               0  |          0  (empty)
                               2  |  -.0765152   .0028879   -26.50   0.000    -.0821786   -.0708519
                                  |
                      empstat1910 |
                               0  |          0  (empty)
                               1  |   .0375222   .0036799    10.20   0.000     .0303056    .0447388
                               2  |          0  (empty)
                                  |
                          lit1910 |
                               0  |          0  (empty)
                               2  |   .4893374   .0078797    62.10   0.000     .4738848      .50479
                               3  |   .0372269   .0112946     3.30   0.001     .0150774    .0593763
                               4  |   .1906309   .0077075    24.73   0.000      .175516    .2057459
                                  |
                        marst1910 |
                               0  |          0  (empty)
                               1  |  -.0240459   .0024073    -9.99   0.000    -.0287669    -.019325
                               2  |  -.0459757   .0063145    -7.28   0.000    -.0583589   -.0335925
                               4  |  -.1147958   .0107946   -10.63   0.000    -.1359648   -.0936268
                               5  |  -.1048792   .0063278   -16.57   0.000    -.1172884   -.0924701
                                  |
                      famsize1910 |  -.0023112   .0003299    -7.01   0.000     -.002958   -.0016643
                                  |
                       school1910 |
                               0  |          0  (empty)
                               2  |   .0201352   .0045524     4.42   0.000     .0112077    .0290627
                                  |
                     labforce1910 |
                               0  |          0  (empty)
                               2  |          0  (empty)
                                  |
                     wksunemp1910 |  -.0000993   .0000194    -5.12   0.000    -.0001374   -.0000613
---------------------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             10.078
                                                   Chi-sq(1) P-val =    0.0015
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):             9708.215
                         (Kleibergen-Paap rk Wald F statistic):         10.246
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Warning: estimated covariance matrix of moment conditions not of full rank.
         overidentification statistic not reported, and standard errors and
         model tests should be interpreted with caution.
Possible causes:
         number of clusters insufficient to calculate robust covariance matrix
         singleton dummy variable (dummy with one 1 and N-1 0s or vice versa)
partial option may address problem.
------------------------------------------------------------------------------
Collinearities detected among instruments: 1 instrument(s) dropped
Instrumented:         outflow
Included instruments: draftrate 2.urban1910 1.skill1910 3.skill1910 4.skill1910
                      5.skill1910 6.skill1910 7.skill1910 8.skill1910
                      9.skill1910 10.skill1910 2.farm1910 1.empstat1910
                      2.lit1910 3.lit1910 4.lit1910 1.marst1910 2.marst1910
                      4.marst1910 5.marst1910 famsize1910 2.school1910
                      wksunemp1910
Excluded instruments: treat
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
Dropped collinear:    2.empstat1910 2.labforce1910
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su lnlido if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  3.0754403

.                 estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  10.246255

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.01117768

.                 est store regA2

. 
.         * PANEL B COLUMN 3: 
.         ivreghdfe mfg (outflow = treat) $controls if abe_nysiis_standard==1 & maxmover==0, a(fips birthyr bpl year) cluster(fips)
Warning - collinearities detected
Vars dropped:       2.empstat1910 2.labforce1910
(MWFE estimator converged in 25 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on fips

Number of clusters (fips) =       2157                Number of obs =   640333
                                                      F( 23,  2156) =  2517.26
                                                      Prob > F      =   0.0000
Total (centered) SS     =  85239.55911                Centered R2   =   0.0320
Total (uncentered) SS   =  85239.55911                Uncentered R2 =   0.0320
Residual SS             =  82510.12655                Root MSE      =     .359

---------------------------------------------------------------------------------------------------
                                  |               Robust
                              mfg | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |   .0346895   .0205173     1.69   0.091    -.0055463    .0749253
                        draftrate |  -.0018812   .0011099    -1.69   0.090    -.0040578    .0002955
                                  |
                        urban1910 |
                               0  |          0  (empty)
                               2  |   .0454308   .0056025     8.11   0.000     .0344439    .0564177
                                  |
                        skill1910 |
                               0  |          0  (empty)
         Professional, Technical  |  -.0244248   .0049334    -4.95   0.000    -.0340995     -.01475
Managers, Officials, Proprietors  |   .0100295   .0055319     1.81   0.070     -.000819     .020878
            Clerical and Kindred  |   .0114254   .0056141     2.04   0.042     .0004158    .0224351
                   Sales workers  |  -.0274912   .0052762    -5.21   0.000    -.0378382   -.0171442
                       Craftsmen  |   .1228782     .00631    19.47   0.000     .1105039    .1352525
                      Operatives  |    .191095   .0073292    26.07   0.000      .176722     .205468
   Service Workers (priv househ)  |          0   .0044834     0.00   1.000    -.0087923    .0087923
                   Farm Laborers  |   .0536616   .0057781     9.29   0.000     .0423304    .0649928
                        Laborers  |   .2049341   .0060642    33.79   0.000     .1930419    .2168263
                                  |
                         farm1910 |
                               0  |          0  (empty)
                               2  |  -.0348294   .0024143   -14.43   0.000     -.039564   -.0300948
                                  |
                      empstat1910 |
                               0  |          0  (empty)
                               1  |   .0325448   .0054532     5.97   0.000     .0218507    .0432389
                               2  |          0  (empty)
                                  |
                          lit1910 |
                               0  |          0  (empty)
                               2  |   .4171975   .0062597    66.65   0.000     .4049217    .4294732
                               3  |   .0086945   .0102381     0.85   0.396    -.0113832    .0287721
                               4  |  -.0171839   .0069721    -2.46   0.014    -.0308566   -.0035112
                                  |
                        marst1910 |
                               0  |          0  (empty)
                               1  |   .0104972   .0020451     5.13   0.000     .0064865    .0145078
                               2  |   .0218468   .0062052     3.52   0.000      .009678    .0340157
                               4  |  -.0070385   .0097218    -0.72   0.469    -.0261036    .0120265
                               5  |   .0135055   .0054885     2.46   0.014     .0027422    .0242688
                                  |
                      famsize1910 |   .0017369   .0003191     5.44   0.000     .0011111    .0023628
                                  |
                       school1910 |
                               0  |          0  (empty)
                               2  |  -.0154834   .0033476    -4.63   0.000    -.0220483   -.0089185
                                  |
                     labforce1910 |
                               0  |          0  (empty)
                               2  |          0  (empty)
                                  |
                     wksunemp1910 |  -.0003621   .0000211   -17.12   0.000    -.0004035   -.0003206
---------------------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             10.078
                                                   Chi-sq(1) P-val =    0.0015
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):             9708.215
                         (Kleibergen-Paap rk Wald F statistic):         10.246
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Warning: estimated covariance matrix of moment conditions not of full rank.
         overidentification statistic not reported, and standard errors and
         model tests should be interpreted with caution.
Possible causes:
         number of clusters insufficient to calculate robust covariance matrix
         singleton dummy variable (dummy with one 1 and N-1 0s or vice versa)
partial option may address problem.
------------------------------------------------------------------------------
Collinearities detected among instruments: 1 instrument(s) dropped
Instrumented:         outflow
Included instruments: draftrate 2.urban1910 1.skill1910 3.skill1910 4.skill1910
                      5.skill1910 6.skill1910 7.skill1910 8.skill1910
                      9.skill1910 10.skill1910 2.farm1910 1.empstat1910
                      2.lit1910 3.lit1910 4.lit1910 1.marst1910 2.marst1910
                      4.marst1910 5.marst1910 famsize1910 2.school1910
                      wksunemp1910
Excluded instruments: treat
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
Dropped collinear:    2.empstat1910 2.labforce1910
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su mfg if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .17972368

.                 estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  10.246255

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  .01214132

.                 est store regA3

. 
.         * PANEL B COLUMN 4: 
.         ivreghdfe mgr (outflow = treat) $controls if abe_nysiis_standard==1 & maxmover==0 , a(fips birthyr bpl year) cluster(fips)
Warning - collinearities detected
Vars dropped:       2.empstat1910 2.labforce1910
(MWFE estimator converged in 25 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on fips

Number of clusters (fips) =       2157                Number of obs =   640333
                                                      F( 23,  2156) =  6469.26
                                                      Prob > F      =   0.0000
Total (centered) SS     =  96880.32511                Centered R2   =   0.2041
Total (uncentered) SS   =  96880.32511                Uncentered R2 =   0.2041
Residual SS             =  77103.29972                Root MSE      =     .347

---------------------------------------------------------------------------------------------------
                                  |               Robust
                              mgr | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |  -.0095397   .0123953    -0.77   0.442    -.0338476    .0147682
                        draftrate |   .0009223   .0006065     1.52   0.128    -.0002671    .0021117
                                  |
                        urban1910 |
                               0  |          0  (empty)
                               2  |   .0090712   .0023368     3.88   0.000     .0044886    .0136537
                                  |
                        skill1910 |
                               0  |          0  (empty)
         Professional, Technical  |   .7585342     .00723   104.92   0.000     .7443557    .7727126
Managers, Officials, Proprietors  |   .5779822   .0081475    70.94   0.000     .5620044    .5939599
            Clerical and Kindred  |   .1443068   .0083453    17.29   0.000     .1279411    .1606725
                   Sales workers  |   .2030998   .0100194    20.27   0.000     .1834512    .2227485
                       Craftsmen  |  -.0053928   .0066357    -0.81   0.416    -.0184058    .0076202
                      Operatives  |   .0316634   .0084936     3.73   0.000      .015007    .0483198
   Service Workers (priv househ)  |          0   .0071874     0.00   1.000     -.014095     .014095
                   Farm Laborers  |  -.0142534   .0078842    -1.81   0.071    -.0297149    .0012081
                        Laborers  |  -.0121412   .0074423    -1.63   0.103    -.0267361    .0024537
                                  |
                         farm1910 |
                               0  |          0  (empty)
                               2  |  -.0114246   .0017634    -6.48   0.000    -.0148827   -.0079665
                                  |
                      empstat1910 |
                               0  |          0  (empty)
                               1  |    .020104   .0026311     7.64   0.000     .0149443    .0252636
                               2  |          0  (empty)
                                  |
                          lit1910 |
                               0  |          0  (empty)
                               2  |   .0138247   .0030371     4.55   0.000     .0078688    .0197807
                               3  |   .0022375   .0048033     0.47   0.641    -.0071821     .011657
                               4  |   .0589096   .0026902    21.90   0.000     .0536338    .0641853
                                  |
                        marst1910 |
                               0  |          0  (empty)
                               1  |  -.0494134   .0017427   -28.35   0.000     -.052831   -.0459958
                               2  |  -.0497709   .0050399    -9.88   0.000    -.0596545   -.0398873
                               4  |  -.0730239    .008978    -8.13   0.000    -.0906303   -.0554175
                               5  |  -.0787402   .0045186   -17.43   0.000    -.0876015   -.0698789
                                  |
                      famsize1910 |  -.0028017   .0002344   -11.95   0.000    -.0032613   -.0023421
                                  |
                       school1910 |
                               0  |          0  (empty)
                               2  |   .0443386   .0030173    14.69   0.000     .0384215    .0502557
                                  |
                     labforce1910 |
                               0  |          0  (empty)
                               2  |          0  (empty)
                                  |
                     wksunemp1910 |   .0002231   .0000154    14.45   0.000     .0001928    .0002534
---------------------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             10.078
                                                   Chi-sq(1) P-val =    0.0015
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):             9708.215
                         (Kleibergen-Paap rk Wald F statistic):         10.246
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Warning: estimated covariance matrix of moment conditions not of full rank.
         overidentification statistic not reported, and standard errors and
         model tests should be interpreted with caution.
Possible causes:
         number of clusters insufficient to calculate robust covariance matrix
         singleton dummy variable (dummy with one 1 and N-1 0s or vice versa)
partial option may address problem.
------------------------------------------------------------------------------
Collinearities detected among instruments: 1 instrument(s) dropped
Instrumented:         outflow
Included instruments: draftrate 2.urban1910 1.skill1910 3.skill1910 4.skill1910
                      5.skill1910 6.skill1910 7.skill1910 8.skill1910
                      9.skill1910 10.skill1910 2.farm1910 1.empstat1910
                      2.lit1910 3.lit1910 4.lit1910 1.marst1910 2.marst1910
                      4.marst1910 5.marst1910 famsize1910 2.school1910
                      wksunemp1910
Excluded instruments: treat
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
Dropped collinear:    2.empstat1910 2.labforce1910
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su mgr if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .20555399

.                 estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  10.246255

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.0033389

.                 est store regA4

.                 
.         * PANEL B COLUMN 5: 
.         ivreghdfe craft (outflow = treat) $controls if abe_nysiis_standard==1 & maxmover==0 , a(fips birthyr bpl year) cluster(fips)
Warning - collinearities detected
Vars dropped:       2.empstat1910 2.labforce1910
(MWFE estimator converged in 25 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on fips

Number of clusters (fips) =       2157                Number of obs =   640333
                                                      F( 23,  2156) =  3.1e+05
                                                      Prob > F      =   0.0000
Total (centered) SS     =  117403.7161                Centered R2   =   0.1843
Total (uncentered) SS   =  117403.7161                Uncentered R2 =   0.1843
Residual SS             =  95767.37199                Root MSE      =    .3868

---------------------------------------------------------------------------------------------------
                                  |               Robust
                            craft | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |  -.0336524   .0198471    -1.70   0.090    -.0725738    .0052691
                        draftrate |   .0001297   .0007599     0.17   0.864    -.0013605      .00162
                                  |
                        urban1910 |
                               0  |          0  (empty)
                               2  |   .0063637   .0036776     1.73   0.084    -.0008483    .0135758
                                  |
                        skill1910 |
                               0  |          0  (empty)
         Professional, Technical  |  -.0731267    .009586    -7.63   0.000    -.0919254    -.054328
Managers, Officials, Proprietors  |  -.0173049   .0095826    -1.81   0.071    -.0360969    .0014872
            Clerical and Kindred  |  -.0348859   .0091828    -3.80   0.000    -.0528939   -.0168778
                   Sales workers  |  -.0185017   .0097009    -1.91   0.057    -.0375259    .0005224
                       Craftsmen  |    .619256   .0091784    67.47   0.000     .6012565    .6372555
                      Operatives  |   .0863419    .012276     7.03   0.000      .062268    .1104158
   Service Workers (priv househ)  |          0   .0097202     0.00   1.000     -.019062     .019062
                   Farm Laborers  |   .0399067   .0094394     4.23   0.000     .0213955     .058418
                        Laborers  |    .120876   .0094548    12.78   0.000     .1023346    .1394174
                                  |
                         farm1910 |
                               0  |          0  (empty)
                               2  |  -.0148157   .0022237    -6.66   0.000    -.0191764   -.0104549
                                  |
                      empstat1910 |
                               0  |          0  (empty)
                               1  |    .016454   .0039987     4.11   0.000     .0086123    .0242957
                               2  |          0  (empty)
                                  |
                          lit1910 |
                               0  |          0  (empty)
                               2  |   .0228642    .004273     5.35   0.000     .0144846    .0312439
                               3  |   .0125098   .0075101     1.67   0.096     -.002218    .0272376
                               4  |   .0811419   .0046112    17.60   0.000     .0720991    .0901848
                                  |
                        marst1910 |
                               0  |          0  (empty)
                               1  |  -.0197631   .0019649   -10.06   0.000    -.0236163   -.0159099
                               2  |  -.0162803   .0061293    -2.66   0.008    -.0283003   -.0042604
                               4  |  -.0614445   .0099835    -6.15   0.000    -.0810227   -.0418662
                               5  |  -.0387062   .0054181    -7.14   0.000    -.0493314    -.028081
                                  |
                      famsize1910 |   .0011309   .0002918     3.88   0.000     .0005586    .0017033
                                  |
                       school1910 |
                               0  |          0  (empty)
                               2  |  -.0183901   .0034953    -5.26   0.000    -.0252445   -.0115356
                                  |
                     labforce1910 |
                               0  |          0  (empty)
                               2  |          0  (empty)
                                  |
                     wksunemp1910 |  -.0000929   .0000162    -5.75   0.000    -.0001246   -.0000612
---------------------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             10.078
                                                   Chi-sq(1) P-val =    0.0015
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):             9708.215
                         (Kleibergen-Paap rk Wald F statistic):         10.246
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Warning: estimated covariance matrix of moment conditions not of full rank.
         overidentification statistic not reported, and standard errors and
         model tests should be interpreted with caution.
Possible causes:
         number of clusters insufficient to calculate robust covariance matrix
         singleton dummy variable (dummy with one 1 and N-1 0s or vice versa)
partial option may address problem.
------------------------------------------------------------------------------
Collinearities detected among instruments: 1 instrument(s) dropped
Instrumented:         outflow
Included instruments: draftrate 2.urban1910 1.skill1910 3.skill1910 4.skill1910
                      5.skill1910 6.skill1910 7.skill1910 8.skill1910
                      9.skill1910 10.skill1910 2.farm1910 1.empstat1910
                      2.lit1910 3.lit1910 4.lit1910 1.marst1910 2.marst1910
                      4.marst1910 5.marst1910 famsize1910 2.school1910
                      wksunemp1910
Excluded instruments: treat
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
Dropped collinear:    2.empstat1910 2.labforce1910
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su craft if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .25733954

.                 estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  10.246255

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  -.01177833

.                 est store regA5

.                 
.         * PANEL B COLUMN 6: 
.         ivreghdfe op (outflow = treat) $controls if abe_nysiis_standard==1 & maxmover==0 , a(fips birthyr bpl year) cluster(fips)
Warning - collinearities detected
Vars dropped:       2.empstat1910 2.labforce1910
(MWFE estimator converged in 25 iterations)

IV (2SLS) estimation
--------------------

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on fips

Number of clusters (fips) =       2157                Number of obs =   640333
                                                      F( 23,  2156) =  3049.49
                                                      Prob > F      =   0.0000
Total (centered) SS     =  67653.28437                Centered R2   =   0.0931
Total (uncentered) SS   =  67653.28437                Uncentered R2 =   0.0931
Residual SS             =   61352.5231                Root MSE      =    .3096

---------------------------------------------------------------------------------------------------
                                  |               Robust
                               op | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------------------------+----------------------------------------------------------------
                          outflow |   .0034388   .0185736     0.19   0.853    -.0329852    .0398628
                        draftrate |  -.0005893   .0008406    -0.70   0.483    -.0022379    .0010592
                                  |
                        urban1910 |
                               0  |          0  (empty)
                               2  |  -.0154345   .0039459    -3.91   0.000    -.0231727   -.0076963
                                  |
                        skill1910 |
                               0  |          0  (empty)
         Professional, Technical  |  -.0437268    .002166   -20.19   0.000    -.0479744   -.0394792
Managers, Officials, Proprietors  |  -.0131782    .002239    -5.89   0.000    -.0175689   -.0087875
            Clerical and Kindred  |  -.0288059          .        .       .            .           .
                   Sales workers  |  -.0109724   .0023775    -4.62   0.000    -.0156349     -.00631
                       Craftsmen  |  -.0112452   .0020323    -5.53   0.000    -.0152306   -.0072598
                      Operatives  |   .3842274   .0060182    63.84   0.000     .3724253    .3960295
   Service Workers (priv househ)  |          0   .0034346     0.00   1.000    -.0067354    .0067354
                   Farm Laborers  |    .018202   .0029165     6.24   0.000     .0124826    .0239213
                        Laborers  |   .0963694   .0034796    27.70   0.000     .0895457     .103193
                                  |
                         farm1910 |
                               0  |          0  (empty)
                               2  |  -.0126588   .0019776    -6.40   0.000    -.0165371   -.0087806
                                  |
                      empstat1910 |
                               0  |          0  (empty)
                               1  |  -.0385127   .0056068    -6.87   0.000     -.049508   -.0275173
                               2  |          0  (empty)
                                  |
                          lit1910 |
                               0  |          0  (empty)
                               2  |   .4560206   .0056915    80.12   0.000     .4448592     .467182
                               3  |   .0055831   .0096181     0.58   0.562    -.0132786    .0244449
                               4  |  -.0184928   .0062304    -2.97   0.003     -.030711   -.0062746
                                  |
                        marst1910 |
                               0  |          0  (empty)
                               1  |   .0198481   .0017867    11.11   0.000     .0163442     .023352
                               2  |    .017706   .0055012     3.22   0.001     .0069178    .0284942
                               4  |   .0187528   .0089398     2.10   0.036     .0012212    .0362843
                               5  |   .0221468   .0043473     5.09   0.000     .0136215     .030672
                                  |
                      famsize1910 |     .00203   .0002716     7.48   0.000     .0014975    .0025625
                                  |
                       school1910 |
                               0  |          0  (empty)
                               2  |  -.0132616   .0030693    -4.32   0.000    -.0192808   -.0072424
                                  |
                     labforce1910 |
                               0  |          0  (empty)
                               2  |          0  (empty)
                                  |
                     wksunemp1910 |  -.0000691   .0000142    -4.86   0.000     -.000097   -.0000413
---------------------------------------------------------------------------------------------------
Underidentification test (Kleibergen-Paap rk LM statistic):             10.078
                                                   Chi-sq(1) P-val =    0.0015
------------------------------------------------------------------------------
Weak identification test (Cragg-Donald Wald F statistic):             9708.215
                         (Kleibergen-Paap rk Wald F statistic):         10.246
Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                         15% maximal IV size              8.96
                                         20% maximal IV size              6.66
                                         25% maximal IV size              5.53
Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
------------------------------------------------------------------------------
Warning: estimated covariance matrix of moment conditions not of full rank.
         overidentification statistic not reported, and standard errors and
         model tests should be interpreted with caution.
Possible causes:
         number of clusters insufficient to calculate robust covariance matrix
         singleton dummy variable (dummy with one 1 and N-1 0s or vice versa)
partial option may address problem.
------------------------------------------------------------------------------
Collinearities detected among instruments: 1 instrument(s) dropped
Instrumented:         outflow
Included instruments: draftrate 2.urban1910 1.skill1910 3.skill1910 4.skill1910
                      5.skill1910 6.skill1910 7.skill1910 8.skill1910
                      9.skill1910 10.skill1910 2.farm1910 1.empstat1910
                      2.lit1910 3.lit1910 4.lit1910 1.marst1910 2.marst1910
                      4.marst1910 5.marst1910 famsize1910 2.school1910
                      wksunemp1910
Excluded instruments: treat
Partialled-out:       _cons
                      nb: total SS, model F and R2s are after partialling-out;
                          any small-sample adjustments include partialled-out
                          variables in regressor count K
Dropped collinear:    2.empstat1910 2.labforce1910
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
        fips |      2157        2157           0    *|
     birthyr |        44           0          44     |
         bpl |        49           1          48     |
        year |         2           1           1    ?|
-----------------------------------------------------+
? = number of redundant parameters may be higher
* = FE nested within cluster; treated as redundant for DoF computation

.                 qui su op if e(sample)==1

.                 estadd scalar ymean = `r(mean)'

added scalar:
              e(ymean) =  .13776113

.                 estadd scalar fF = e(widstat)

added scalar:
                 e(fF) =  10.246255

.                 estadd scalar cl = e(N_clust)

added scalar:
                 e(cl) =  2157

.                 estadd scalar meaneff = _b[outflow]*meanout

added scalar:
            e(meaneff) =  .00120358

.                 est store regA6

. 
.         * generate bottom panel for the table
.         #delimit ;
delimiter now ;
.         esttab regA* using "$path/Replication/tables/table6_panelB.tex",
>                    replace star(* 0.10 ** 0.05 *** 0.01)
>                    keep(outflow)
>                    coeflabels(outflow "Post-WWI $\times$ German Outflow$\_{1910-20}$")
>                    not collabels(none) nomtitles nonumbers substitute(\_ _) fragment plain
>                    cells("b(fmt(3)star)" "se(fmt(3)par)")
>                    stats(N ymean meaneff fF, fmt(%9.0fc %9.3fc %9.3fc %9.3fc)                           
>                    label("\\[-1em] \hline Observations"                                                                                         
>                                          "Outcome mean"
>                                          "Effect at mean outflow"
>                                          "K-P F-statistic"));
(file C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table6_panelB.tex not found)
(output written to C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/tables/table6_panelB.tex)

.         #delimit cr
delimiter now cr
.         est clear

.         
. 
end of do-file

.         
.         log close
      name:  <unnamed>
       log:  C:/Users/anf137/Dropbox/projects/WWI German Discrimination/Replication/replication.log
  log type:  text
 closed on:  15 Apr 2022, 14:56:53
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
